DATA Step, Macro, Functions and more

error - pls help resolve

Reply
N/A
Posts: 0

error - pls help resolve

code:
%macro vmfsumm(qtrloc);

%let yymm = %sysfunc(intnx(month,%sysfunc(today()),-1),yymmd7.) ;

%if qtrloc = SysProd %then %let qtr = &yymm.Prod;
%else %if qtrloc = SysDev %then %let qtr = &yymm.Rgrs;
%else %let qtr = &yymm.TestNS;


%let qtrdata = &yymm.Prod;
%let prqdate= %sysfunc(intnx(month,%sysfunc(today()),-3,E),date9.);
%let valdate= %sysfunc(intnx(month,%sysfunc(today()),-1,E),date9.);
*%let crntdate= %sysfunc(intnx(month,%sysfunc(today()),-1,E),worddate17.);
%let dpryrend= %sysfunc(intnx(month,%sysfunc(today()),-9,E),date9.);
%let valm = %sysfunc(intnx(month,%sysfunc(today()),-1),month2.);
%let crntyear = %sysfunc(intnx(month,%sysfunc(today()),-1),year2.);

%let rawdata = jap&valm.&crntyear..dat;

%put &qtrloc &yymm &qtr &prqdate &valdate &crntdate &dpryrend &valm &crntyear &rawdata;

%include "I:\&qtrloc\LifeMaster\&qtr\Programs\Standard\SASCodeIncludes\lib077.mac";
%include &dates;
%dates(datejap);


filename lfcmextr "I:\SysProd\LifeMaster\2009-12Prod\RawData\jap1209.dat";

proc printto log = "I:\&qtrloc\LifeMaster\&qtr\Programs\Standard\Japan\VMFsumm.log" new
print = "I:\&qtrloc\LifeMaster\&qtr\Programs\Standard\Japan\VMFsumm.lst" new;

footnote "Program: I:\&qtrloc\LifeMaster\&qtr\Programs\Standard\Japan\VMFsumm.sas";
footnote2 "Output: I:\&qtrloc\LifeMaster\&qtr\Programs\Standard\Japan\VMFsumm.lst";

%mend vmfsumm;

%vmfsumm(SysTest);
log:
SYMBOLGEN: Macro variable YYMM resolves to 2009-12
SYMBOLGEN: Macro variable YYMM resolves to 2009-12
SYMBOLGEN: Macro variable VALM resolves to 12
SYMBOLGEN: Macro variable CRNTYEAR resolves to 09
SYMBOLGEN: Macro variable QTRLOC resolves to SysTest
SYMBOLGEN: Macro variable YYMM resolves to 2009-12
SYMBOLGEN: Macro variable QTR resolves to 2009-12TestNS
SYMBOLGEN: Macro variable PRQDATE resolves to 31OCT2009
SYMBOLGEN: Macro variable VALDATE resolves to 31DEC2009
SYMBOLGEN: Macro variable CRNTDATE resolves to Dec 31, 2009
SYMBOLGEN: Macro variable DPRYREND resolves to 30APR2009
SYMBOLGEN: Macro variable VALM resolves to 12
SYMBOLGEN: Macro variable CRNTYEAR resolves to 09
SYMBOLGEN: Macro variable RAWDATA resolves to jap1209.dat
SysTest 2009-12 2009-12TestNS 31OCT2009 31DEC2009 Dec 31, 2009 30APR2009 12 09 jap1209.dat
WARNING: Apparent symbolic reference DATES not resolved.
ERROR: Incorrect %INCLUDE statement will not be executed. There is a syntax error.
ERROR: Incorrect %INCLUDE statement will not be executed. There is a syntax error.
ERROR: Incorrect %INCLUDE statement will not be executed. There is a syntax error.
NOTE: Line generated by the invoked macro "VMFSUMM".
572 %include "I:\&qtrloc\LifeMaster\&qtr\Programs\Standard\SASCodeIncludes\lib077.mac"; %include &dates;
572 ! %dates(datejap); filename lfcmextr "I:\SysProd\LifeMaster\2009-12Prod\RawData\jap1209.dat"; proc printto log =
_
_
_
180
180
180
ERROR 180-322: Statement is not valid or it is used out of proper order.
ERROR 180-322: Statement is not valid or it is used out of proper order.
ERROR 180-322: Statement is not valid or it is used out of proper order.

WARNING: Apparent invocation of macro DATES not resolved.
WARNING: The Base Product product with which PRINTTO is associated will expire within 30 days. Please contact your SAS
installation representative to have it renewed.
SYMBOLGEN: Macro variable QTRLOC resolves to SysTest
SYMBOLGEN: Macro variable QTR resolves to 2009-12TestNS
SYMBOLGEN: Macro variable QTRLOC resolves to SysTest
SYMBOLGEN: Macro variable QTR resolves to 2009-12TestNS
SYMBOLGEN: Macro variable QTRLOC resolves to SysTest
SYMBOLGEN: Macro variable QTR resolves to 2009-12TestNS
SYMBOLGEN: Macro variable QTRLOC resolves to SysTest
SYMBOLGEN: Macro variable QTR resolves to 2009-12TestNS
Super Contributor
Posts: 359

Re: error - pls help resolve

Posted in reply to deleted_user
Well first off &dates is not assigned so that code is not included. There is no code shown to define the file referenced by &dates so we cannot know what happened there.
Contributor
Posts: 24

Re: error - pls help resolve

Posted in reply to deleted_user
the variable 'dates' is not defined. SAS will looking for the value of the macro variable, 'dates' , from local and global tables. let me guess, it will search local table for the macro itselt, the local table for the macro I:\&qtrloc\LifeMaster\&qtr\Programs\Standard\SASCodeIncludes\lib077.mac, and the global table. That why there are three error messages - there is an Error message posted after failed to search each of the three tables.
SAS Employee
Posts: 58

Re: error - pls help resolve

Posted in reply to deleted_user
Can we see what's in your lib077.mac file? Then I'll bet we can figure this one out.
Ask a Question
Discussion stats
  • 3 replies
  • 282 views
  • 0 likes
  • 4 in conversation