# How to improve spacing between consecutive tcblistings?

I would like to have my SAS code with more or less the same distances between the previous sentence and the following one. I did it putting it in a tcolorbox with before skip=0pt plus 2pt minus 2pt and after skip=4pt plus 2pt minus 2pt (perhaps there are better methods I don't know).

I don't want one data step be separated across pages (putting it within a tcolorbox I can achieve that) but I want that two different data steps could be divided.

What I did works but there is too much space between the end of one step and the start of another. I know I can use \vspace{-2pt} to solve this, but there's no way to do it automatically?

\documentclass[a4paper,12pt, twoside]{book}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[a4paper]{geometry}
\geometry{verbose,tmargin=3cm,bmargin=3.5cm,lmargin=4cm,rmargin=3cm,marginparwidth=2.5cm}
\usepackage{fancyhdr}
\frenchspacing
\setlength{\parskip}{1ex}
\usepackage[all]{nowidow}

\usepackage{ragged2e}
\raggedbottom
\usepackage{upquote}% per avere gli apici dritti nelle stringhe

\usepackage[most]{tcolorbox}
\tcbuselibrary{listings}

\tcbset{colback=blue!4!white,colframe=blue,
fonttitle=\bfseries,
before skip = 16pt,
parbox=false,
before upper={\parindent0pt},
}

\usepackage{listings}

\newcommand{\stilestringa}{\color[rgb]{0.639,0.082,0.082}\ttfamily}
\newcommand{\stilecomandoa}{\color{blue}\ttfamily}
\newcommand{\stilecomandob}{\color{blue!50}\ttfamily}
\newcommand{\stilecommenti}{\color[RGB]{77,159,53}\ttfamily}
\newcommand{\stilewarnings}{\color[RGB]{93,138,168}\ttfamily}
\newcommand{\stileerrori}{\color{red}\ttfamily}

\newcommand{\sasinline}[1]{\lstinline[style=saslst,    basicstyle=\ttfamily]!#1!}
\newcommand{\sasstringemph}[1]{\stilestringa \emph{#1}}
\newcommand{\sasutente}[1]{\emph{#1}}

\lstdefinestyle{saslst}{
columns=flexible,
language=SAS,
morekeywords=[1]{quit, proc, let, macro, mend},
morekeywords=[2]{access, obs, firstobs, format, append, sort, sql, transpose, compare, in, when, otherwise, select},
morecomment=[f]{*},
morecomment=[s]{/*}{*/},
morecomment=[n]{/*}{*/},
morestring=[b]{"},
escapechar=|,
keywordstyle={[1]\stilecomandoa},
keywordstyle={[2]\stilecomandob},
stringstyle=\stilestringa,
showstringspaces=false,
keepspaces=true,
sensitive=false,
breaklines=true,
breakindent=0pt,
inputencoding=utf8/latin1
}

\newtcblisting{sas}{%
listing only,
%    before skip=0pt plus 2pt minus 2pt,
%  after skip=4pt plus 2pt minus 2pt,
%   code={\vspace{-2pt}},
%   top=-2pt,
%  bottom=-2pt,
enhanced,
opacityfill=0,
left=0mm,
boxsep=0pt,
boxrule=0pt,
listing engine=listings,
listing options={style=saslst,
basicstyle=\small\ttfamily
}
}

\begin{document}
\noindent Here is a single \sasinline{data} step:
\begin{sas}
data classe;
set  sashelp.class;
when age=11;
run;
\end{sas}
\noindent Here there is too much space
between \sasinline{/* END OF ONE STEP */}
and \sasinline{/* START OF ANOTHER STEP */}:
\begin{sas}
data classe;
set  sashelp.class;
when age=11;
run;
/* END OF ONE STEP */
\end{sas}
\begin{sas}
/* START OF ANOTHER STEP */
data classe;
set  sashelp.class;
when age=11;
run;
\end{sas}
\noindent This seems to work \textasciicircum\textasciicircum\textasciicircum
\end{document}
`