DATA Step, Macro, Functions and more

How to use SYSTASK?

Reply
Respected Advisor
Posts: 3,902

How to use SYSTASK?

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
Respected Advisor
Posts: 3,777

Re: How to use SYSTASK?

This is a common problem solved with %UNQUOTE.

systask command %unquote(%str(%')&BatchIt%str(%'));
Respected Advisor
Posts: 3,902

Re: How to use SYSTASK?

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
Ask a Question
Discussion stats
  • 2 replies
  • 158 views
  • 0 likes
  • 2 in conversation