BookmarkSubscribeRSS Feed
foxrol94
Fluorite | Level 6

Hi, 

 

I have some trouble cause i would like to create a date variable dat in a sas dataset and i'm doing lke this:

 


%let date_traitement=%sysfunc(intnx(month, %sysfunc(today()),-1,e), ddmmyyn8.);
%put NOTE: DATE de Traitement ====> &date_traitement.;
data test;
	set sashelp.Prdsal2;
	date0= put(input(&date_traitement.,ddmmyy10.), ddmmyy10.);
run;

 

Dateset is created but the variable dat have values 3101202 instead of 31012018. I'm a bit confused.

 

Thnaks for your support

 

 

1 REPLY 1
FredrikE
Rhodochrosite | Level 12

Try put &date between quotes:

 

"&date_traitement."

 

//Fredrik

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 1 reply
  • 959 views
  • 0 likes
  • 2 in conversation