316 data _null_;
317 length command $500;
318 set definition;
319 startdate=mdy(input(substr(start,6, 2),2.), 1, input(substr(start,1,
4),4.));
320 enddate=mdy(input(substr(end,6, 2),2.), 1, input(substr(end,1, 4),4.));
321 numMo=intck('mon',startdate, enddate);
322 extentedend=cats(
year(intnx('month',enddate,3)),'/',month(intnx('month',enddate,3)));
323 extend=intnx('month',enddate,3);
324 eend=put(extend, yymms7.);
325
326 command =catx(' ',"&filepath", client, numMo,start, end, start, eend);
327 call execute('%nrstr(%extraction('||command||'));');
328 run;
NOTE: There were 1 observations read from the data set WORK.DEFINITION.
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
NOTE: CALL EXECUTE generated line.
WARNING: Apparent invocation of macro EXTRACTION not resolved.
NOTE: Line generated by the CALL EXECUTE routine.
1 + %extraction(N:\PM\dataExtraction\codes\extraction.bat ABB 1 2006/01
2006/02 2006/01
-
180
1 !+2006/05
ERROR 180-322: Statement is not valid or it is used out of proper order.
2 +
3 + );
ERROR: Expected semicolon not found. The macro will not be compiled.
ERROR: A dummy macro will be compiled.
329
330
331 %macro extraction(command)
332 data _null_;
333 call system(&command);
334 run;
335 %mend extraction;
In the end, I want to execute
*
call system('N:\PM\dataExtraction\codes\extraction.bat ABB ccc 2 2006/01
2006/02 2006/01 2006/5')
in this case. But apprently, My code does not pass the string to the macro
properly.
How can I fix this problem?
Thanks
Jeff
*
hs AT dc-sug DOT org ("Howard Schreier)" - 31 Oct 2008 04:02 GMT
>316 data _null_;
>
[quoted text clipped - 85 lines]
>Jeff
>*
You have to define the macro *before* you attempt to use it.
But why not simplify by getting rid of the macro and instead putting CALL
SYSTEM in the DATA step which does all the derivations?
Fehd, Ronald J. (CDC/CCHIS/NCPHI) - 31 Oct 2008 14:21 GMT
you must have the definition of macro extraction
before the data _Null_ step which calls it.
fyi
I will guess that your extraction.bat calls a sas program
check your syntax:
http://www.sascommunity.org/wiki/Batch_processing_under_Windows
as you have named your parameters
which should be in option SysParm
Ron Fehd the macro maven CDC Atlanta GA USA RJF2 at cdc dot gov
> -----Original Message-----
> From: owner-sas-l@listserv.uga.edu
[quoted text clipped - 100 lines]
> Jeff
> *