Hi @Emma2021
One wat to get around the potential "too long" scenario would be writing the code into a separate file, and then running the newly created file 😉
Basically take @Tom original code and re-arrange it slightly
filename dyncode temp;
data _null_;
length str $300;
file dyncode lrecle=300;
put 'proc datasets nolist lib=work;' ;
put +3 'modify have ;' ;
put +3 'label ';
do until(eof);
SET sashelp.vcolumn(where=(libname='WORK' and memname='HAVE' and upcase(substr(name,1,3)) in ('VAR','NUM') and label ne ' '))
end=eof;
str = catx('=',nliteral(name),quote(catx(' ',substr(name,1,3),label),"'"));
put +6 str;
end;
put +3 ';';
put 'run; quit; ';
run;
%include dyncode;
The generated code should be a single Proc Datasets step.
Hope this help
... View more