BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
kotapatipavan95
Calcite | Level 5

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?

 

1 ACCEPTED SOLUTION

Accepted Solutions
japelin
Rhodochrosite | Level 12
data _null_;
  dt=lowcase('01JAN2022');
run;

or

 

%let dt=%lowcase(01JAN2022);

View solution in original post

4 REPLIES 4
Reeza
Super User

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?

 


 

 

kotapatipavan95
Calcite | Level 5

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

andreas_lds
Jade | Level 19

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;
japelin
Rhodochrosite | Level 12
data _null_;
  dt=lowcase('01JAN2022');
run;

or

 

%let dt=%lowcase(01JAN2022);
How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 1271 views
  • 2 likes
  • 4 in conversation