BookmarkSubscribeRSS Feed
Patrick
Opal | Level 21
Hi all
Can one of you tell me how to use "systask" in the code below.
I just can't figure it out!
Cheers, Patrick

proc format;
picture datestamp (default=19)
other='%Y%0m%0d_%0H%0M%0S' (datatype=datetime)
;
run;

%global SASexe SASconfig SASautoexec SASsysin SASlog SASprint;
%let timestamp=%sysfunc(datetime(),datestamp.);

%let job=job1;

%let SASexe = "c:\Program Files\SAS\SASFoundation\9.2\sas.exe";
%let SASsysin = -sysin "C:\Documents and Settings\ssapam\My Documents\My SAS Files\9.2\&job..sas";
%let SASlog = -log "c:\test\&job&timestamp..log";
%let SASprint = -print "c:\test\&job&timestamp..lst";

%let BatchIt=&SASexe &SASconfig &SASautoexec &SASsysin &SASlog &SASprint -nosplash -icon;

%macro test;
/* working */
%sysexec &BatchIt;

/* NOT working */
/* systask command &BatchIt;*/

/* NOT working */
/* systask command %str(%')&BatchIt%str(%');*/
%mend;
%test
2 REPLIES 2
data_null__
Jade | Level 19
This is a common problem solved with %UNQUOTE.

systask command %unquote(%str(%')&BatchIt%str(%'));
Patrick
Opal | Level 21
That worked. Thanks data _null_ !
Do you also have an explanation why this %unquote is needed? I don't get it.
Cheers, Patrick

.... Think I got it! And I thought always that %' means "masking" the following character for macro resolution. I was never aware that this is a "quoting". Learnt something 🙂


Message was edited by: Patrick

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 1011 views
  • 0 likes
  • 2 in conversation