Help using Base SAS procedures

%let currdt=put(today(),yymmdd10.)

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 92
Accepted Solution

%let currdt=put(today(),yymmdd10.)

I run a script everyday. And the below variable assigned is changed everyday. I want to avoid manually changing.

%let currdt=20150708;

How to automate the variable assignment to today()? Using the minimal coding.

Something like this %let currdt=put(today(),yymmdd10.)?

If I use DATA _NULL_ then the variable can only be used inside the datastep. This variable will be used everywhere in script.


Accepted Solutions
Solution
‎07-08-2015 06:54 AM
Frequent Contributor
Posts: 92

Re: %let currdt=put(today(),yymmdd10.)

data _NULL_;

  call symputx('currdt' ,put(today(), yymmddn8.));

  output;

run;

View solution in original post


All Replies
Solution
‎07-08-2015 06:54 AM
Frequent Contributor
Posts: 92

Re: %let currdt=put(today(),yymmdd10.)

data _NULL_;

  call symputx('currdt' ,put(today(), yymmddn8.));

  output;

run;

Contributor
Posts: 65

Re: %let currdt=put(today(),yymmdd10.)

As you are not creating any dataset, there is no need to use output statement in the code.

data _NULL_;

  call symputx('currdt' ,put(today(), yymmddn8.));

run;

Super User
Posts: 10,048

Re: %let currdt=put(today(),yymmdd10.)

%let currdt=%sysfunc(today(),yymmdd10.) ;

🔒 This topic is solved and locked.

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

Discussion stats
  • 3 replies
  • 502 views
  • 2 likes
  • 3 in conversation