You could also investigate what the EG migration wizard could do for you - especially when used with a pre-generated mapping file.
Migrate SAS Content with the Migration Wizard
... View more
You are using two level name to reference that SAS dataset, mylib.mydataset, so you will need to figure out what filename that should be.
%let libref=%scan(work.&dsn,-2,.);
%let path=%sysfunc(pathname(&libref));
%let fname=&path/%sysfunc(lowcase(%scan(&dsn,-1,.))).sas7bdat.gz;
%if %sysfunc(fileexist(&fname))%then %do;
%put Found a GZIP version of the file at &=fname ;
....
%end;
... View more
Looks like casting as a VARCHAR does the trick! Thanks for the nudge in the right direction @Reeza! LPAD(cast(have_number as varchar(2)), 2, '0') as want_character
... View more