Line by line.
The File Statement specifies the output file for the Put Statements to come.
file ”&G_IFC_PATH/DATA/WDATA/cmsdate.txt”;
This seems to put the &acdt macro variable into some desired format (I can't see &acdt).
cmsdate=put(compress(put(&acdt,yymmdd10.),’-’),8.):
This Put Statement puts the value of cmsdate in the first column in the file you specified in the File Statement.
put @1 cmsdate $8.;
I recommend to review the documentasion first.
> What does this do? Since no output dataset or temp dataset saved, does it changing the content of txt file?
The text file is rewritten because it is put into the file specified in the file statement.
> Does variable cmsdate still exist in the system after this program is run?
No dataset is generated, so no variables exist.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.