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);
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.