Hello!
I'm trying to change the name of my outfile....
Currently I'm using today's date to stamp the date at the end of my file name.
%let numdate = %sysfunc(today(), MONYY7.);
proc export data=WORK.FORMAT_FIELDS
outfile="Z:\Commercial Operations\TRANSITION\test\TERR_TRX_SENSORS&numdate..txt"
dbms=dlm
replace;
delimiter='|';
run;
So what I'm getting for my file name is TERR_TRX_SENSORSJULY2019.
This works great, however what I would like to do is instead of using today's date, I would like to use a date within my data set.
For example, In my WORK.FORMAT_FIELDS table, I have a field called CAL_MTH_DT. The CAL_MTH_DT is 5/31/2019, so I would like it to be something like:
%let numdate = %sysfunc(CAL_MTH_DT, MONYY7.);
proc export data=WORK.FORMAT_FIELDS
outfile="Z:\Commercial Operations\TRANSITION\test\TERR_TRX_SENSORS&numdate..txt"
dbms=dlm
replace;
delimiter='|';
run;
That way my file name comes out as TERR_TRX_SENSORSMAY2019.
But this is working and I'm trying to figure out how to make the date the date from my data set if possible.
Thank you!