cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic output name

SASNE
Obsidian | Level 7

Dynamic output name

Message contains an image

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

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

Ksharp
Super User

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;
SASNE
Obsidian | Level 7

Re: Dynamic output name

Hi KSharp,

 

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

 

thanks

Highlighted
Kurt_Bremser
Super User

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;