BookmarkSubscribeRSS Feed
SASNE
Obsidian | Level 7

Hi Gurus,

 

I would like to ask if anyone know how to dynamically assign the output file name with current system datetime ?

 

I have attached the sample.

 

 

Thank you for your help


CurrentDateTime.PNG
4 REPLIES 4
Kurt_Bremser
Super User

You might try to use one of the automatic macro variables that contain time information. Although I'm not sure if it breaks EG's dataset tracking (making creating process flows harder).

Ksharp
Super User
data x_%sysfunc(translate(%sysfunc(datetime(),datetime20.),_,:));
input col1 $ col2 $ col3 $;
x=catx(',',of col1-col3);
cards;
s y x
;
run;
SASNE
Obsidian | Level 7

Hi KSharp,

 

Thank you for your help, do you know how to do that in proc sql?

 

thanks

Kurt_Bremser
Super User

@SASNE wrote:

Hi KSharp,

 

Thank you for your help, do you know how to do that in proc sql?

 

thanks


proc sql;
create table x_%sysfunc(translate(%sysfunc(datetime(),datetime20.),_,:)) as
select ....
from ....
;
quit;

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 1155 views
  • 0 likes
  • 3 in conversation