DATA Step, Macro, Functions and more

Creating times stamp on output files

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 127
Accepted Solution

Creating times stamp on output files

[ Edited ]

Dear experts,

how can should I adjust the following data set?

 

data time_stamp; 
input status $ date time;
 datalines;
start '%put %sysfunc(date(),worddate.).' '%put %sysfunc(time(),timeampm.)'
;

Thanks, SH


Accepted Solutions
Solution
‎11-10-2016 04:10 AM
Super User
Posts: 7,771

Re: Creating times stamp on output files

Posted in reply to Sir_Highbury

Are you trying to take part in the Obfuscated SAS Code Contest?

data time_stamp;
status = 'start';
date = put(date(),worddate.);
time = put(time(),timeampm.);
run;

achieves the same, works and is more readable.

 

Macro triggers don't work in cards; or datalines; blocks.

 

What are you trying to do, anyway?

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers

View solution in original post


All Replies
Solution
‎11-10-2016 04:10 AM
Super User
Posts: 7,771

Re: Creating times stamp on output files

Posted in reply to Sir_Highbury

Are you trying to take part in the Obfuscated SAS Code Contest?

data time_stamp;
status = 'start';
date = put(date(),worddate.);
time = put(time(),timeampm.);
run;

achieves the same, works and is more readable.

 

Macro triggers don't work in cards; or datalines; blocks.

 

What are you trying to do, anyway?

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
☑ This topic is solved.

Need further help from the community? Please ask a new question.

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