BookmarkSubscribeRSS Feed
deleted_user
Not applicable
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
3 REPLIES 3
Flip
Fluorite | Level 6
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.
SUN59338
Obsidian | Level 7
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.
PatrickG
SAS Employee
Can we see what's in your lib077.mac file? Then I'll bet we can figure this one out.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 1076 views
  • 0 likes
  • 4 in conversation