I've spent hours on this, but it will not work when I try to run it as a dataset. What I am trying to do is read in multiple datasets with the same ending, but different prefixes. Such as: d170726_1 d170726_2 d170822 d170925 They are datasets within the same fiscal quarter, so I want to combine them into one quarter overall, but first I must run some logic. It is much more simpler to do this with a macro since this will be a continuing issue for the entire year since the data comes in waves. I want to make the process generalizable, but there needs to be some sorting, etc. before the merging. So... I placed these names in a .txt file using: data null; length dsn $9. ; infile "&proj.&sp.CY2017&sp.datasets.txt" truncover; input @1 dsn $9. ; i+1;
ii = left(put(i,2.));
call symput('n',ii);
call symput('dsn'||ii,left(dsn)); run; when run %put all , the codes show: dsn1 = 1232_test, dsn2 = 42521_1_test, etc. Cool great. I use this in the code data&year..&&dsn&i._mst_tbl... And these are my results 😧 d170726_1 WARNING: Apparent symbolic reference DSN1_MST_TBL not resolved. WARNING: Apparent symbolic reference DSN1_CPT_CODE not resolved. WARNING: data2017.&dsn1_cpt_code does not exist Please help 😞 What am I doing wrong? I'm going insane.
... View more