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);

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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