Desktop productivity for business analysts and programmers

Dynamic output name

Reply
Contributor
Posts: 37

Dynamic output name

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
Super User
Posts: 7,405

Re: Dynamic output name

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

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Super User
Posts: 9,865

Re: Dynamic output name

data x_%sysfunc(translate(%sysfunc(datetime(),datetime20.),_,:));
input col1 $ col2 $ col3 $;
x=catx(',',of col1-col3);
cards;
s y x
;
run;
Contributor
Posts: 37

Re: Dynamic output name

Hi KSharp,

 

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

 

thanks

Super User
Posts: 7,405

Re: Dynamic output name


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;
---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Ask a Question
Discussion stats
  • 4 replies
  • 186 views
  • 0 likes
  • 3 in conversation