LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (October 1998, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 12 Oct 1998 20:24:26 GMT
Reply-To:     whiterr@MY-DEJANEWS.COM
Sender:       "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From:         whiterr@MY-DEJANEWS.COM
Organization: Deja News - The Leader in Internet Discussion
Subject:      Re: Macro Sub For INFILE Statement

Myra, after your %MACRO statement, add %GLOBAL INFI1; to tell the macro to allow INF1 to be used after you call the macro. You might need to put INF2 and DAT1 in the %GLOBAL statement, too. Otherwise, they are only known LOCALly within the macro.

In article <6vthcq$q5a$1@nnrp1.dejanews.com>, Myra.Oltsik@responseinsurance.com wrote: > I work in MVS and WinNT, often with SAS/CONNECT. Most of the files I access > are VSAM file, but their backups are flat files. On Mondays I need to access > the backups while on Tues thru Fri I access the VSAM file. I've tried using a > Macro Variable to indicate whether to use the option VSAM in the INFILE > statement, but it hasn't worked. I can > > %MACRO MIFO; > %IF &TDAY = 2 %THEN %DO; > /* TEMP POLICY COVERAGE */ > FILENAME COV ('X017011.ACSV456D.BKUPD(0)' > 'D017011.ACSV325D.BKUPD(-1)') DISP=SHR; > FILENAME POL ('X017010.ACSV456D.BKUPD(0)' > 'D017010.ACSV325D.BKUPD(-1)') DISP=SHR; > %LET INF1 = %STR(INFILE POL END=TRAIL;); > %LET INF2 = %STR(INFILE COV END=TRAIL;); > %LET DAT1 = %STR(IF TRANDATE = TODAY() - 2 OR TRANDATE = TODAY() - 3;); > %END; > %ELSE %DO; > /* TEMP POLICY TRANSACTIONS */ > FILENAME COV 'X0170111.POTMPPCY.COV.PATH1' DISP=SHR; > FILENAME POL 'X0170101.POTMPPCY.TRN.PATH1' DISP=SHR; > %LET INF1 = %STR(INFILE POL VSAM END=TRAIL;); > %LET INF2 = %STR(INFILE COV VSAM END=TRAIL;); > %LET DAT1 = %STR(IF TRANDATE = TODAY() - 1;); > %END; > %PUT &DAT1; > %PUT &INF1; > %PUT &INF2; > %MEND MIFO; > > DATA POLI; > &INF1; > INPUT > @ 11 POLICYNO $CHAR8. > @; > IF TRAIL = 1 THEN DELETE; > REC = _N_; > INPUT > @ 1 PRIMEKEY PD10. > @ 379 TRANSTYP 2. > ... more code > RUN; > > The &INF1 produces a WARNING: Apparent symbolic reference INF1 not resolved. > The Data Steps are long. I'd rather not have two separate data steps executed > depending on the day of the week. I'd appreciate any suggestions. Thank you. > > Myra > > -----------== Posted via Deja News, The Discussion Network ==---------- > http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own >

-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own


Back to: Top of message | Previous page | Main SAS-L page