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-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

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!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 1 reply
  • 1026 views
  • 0 likes
  • 2 in conversation