- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Posted 01-17-2023 10:30 PM
(743 views)
Data _null_;
Job_date=today();
Format job_date date9.;
Run;
%let sampdate=&g_job_date;
Call symput(”g_job_date”, put(job_date, date9.));
It says call symput statement is used out of order and why?
Job_date=today();
Format job_date date9.;
Run;
%let sampdate=&g_job_date;
Call symput(”g_job_date”, put(job_date, date9.));
It says call symput statement is used out of order and why?
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Call symput is expected to be in a data step. Your example has it after the end of the shown data step. Run statement ends a data step.
@HeatherNewton wrote:
Data _null_;
Job_date=today();
Format job_date date9.;
Run;
%let sampdate=&g_job_date;
Call symput(”g_job_date”, put(job_date, date9.));
It says call symput statement is used out of order and why?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Try this instead:
Data _null_;
Job_date=today();
Format job_date date9.;
Call symput("g_job_date", put(job_date, date9.));
Run;
%put &=g_job_date;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
As an alternative, you can use the macro language %SYSFUNC function to call TODAY() to get the date, without using a data step:
3 %let g_job_date=%sysfunc(today(),date9) ; 4 %put &=g_job_date ; G_JOB_DATE=18JAN2023
The Boston Area SAS Users Group is hosting free webinars!
Next up: Troy Martin Hughes presents Calling Open-Source Python Functions within SAS PROC FCMP: A Google Maps API Geocoding Adventure on Wednesday April 23.
Register now at https://www.basug.org/events.
Next up: Troy Martin Hughes presents Calling Open-Source Python Functions within SAS PROC FCMP: A Google Maps API Geocoding Adventure on Wednesday April 23.
Register now at https://www.basug.org/events.