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

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