for example, the file name is abcd_01jan2022.csv
using DATE9. function, I am able to get 01JAN2022 but in my case scenario, month should be in lowcase.
Can any one please help?
data _null_;
dt=lowcase('01JAN2022');
run;
or
%let dt=%lowcase(01JAN2022);
Use the lowcase/lower functions?
How are you getting the date? How are you creating the file name?
@kotapatipavan95 wrote:
for example, the file name is abcd_01jan2022.csv
using DATE9. function, I am able to get 01JAN2022 but in my case scenario, month should be in lowcase.
Can any one please help?
I am using
%let date = %sysfunc(today(), DATE9.);
data file_name;
infile "/path/abcd_&date..csv;
run;
when I run this, the program is trying to import file name abcd_13JAN2022.csv
but the file naming(file I am trying to import) has lower case for month i.e. abcd_13jan2022.csv
Either wrap %sysfunc in %lowcase, or wrap &date. in the infile statement in %lowcase.
%let date = %lowcase(%sysfunc(today(), DATE9.));
data file_name;
infile "/path/abcd_%lowcase(&date.).csv;
run;
data _null_;
dt=lowcase('01JAN2022');
run;
or
%let dt=%lowcase(01JAN2022);
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.