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);
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
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.