Thanks for the swift reply. Unfortunately the code provided did not fix the problem but it might have had as much to do with a poor example on my side. I've included an updated scenario below featuring just a single column but the aim of my opening topic remains, having one solution that means I don't have to individually code ~50 retain statements by hand. /* Set up test data */
data &_Output.;
infile datalines dlm=',';
input ID :8. Additional_Information :$16.;
datalines;
1,Some random junk
2,
3,
4,
5,
;
run;
/* Manual "working" solution */
data &_Output2.;
set &_Output.;
retain _Additional_Information;
if missing(Additional_Information)
then Additional_Information=_Additional_Information;
else _Additional_Information=Additional_Information;
run;
/* Interpretation of original proposed solution. Doesn't retain values correctly */
data &_Output3. (drop=conv:);
set &_Output.;
array orig{1} Additional_Information;
array conv{1};
retain conv:;
do i=1 to 1;
if not missing(orig{i}) then conv{i}=orig{i};
else orig{i}=conv{i};
end;
run;
/* Further interpretation, same results :( */
data &_Output4. (drop=conv:);
set &_Output.;
array orig{1} Additional_Information;
array conv{1};
retain conv:;
do i=1 to 1;
if orig{i}^='' then conv{i}=orig{i};
else orig{i}=conv{i};
end;
run;
Thanks again for your help so far.
... View more