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

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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