Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Mathematics
General TopicsResearchOperations ResearchStatisticsMathematical LogicNumerical AnalysisUndergraduate MathAlgebra HelpRecreational Math
Math Software
MapleMathematicaMATLABScilabSASSPSS

Math Forum / Math Software / SAS / October 2008



Tip: Looking for answers? Try searching our database.

call execute

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jeff - 31 Oct 2008 03:45 GMT
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
> *
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.