| Date: | Tue, 19 May 2009 07:51:40 -0400 |
| Reply-To: | "SUBSCRIBE SAS-L Joe H. Smith" <peesari.mahesh@GMAIL.COM> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | "SUBSCRIBE SAS-L Joe H. Smith" <peesari.mahesh@GMAIL.COM> |
| Subject: | %include in Macros |
|---|
HI all;
When i am runing macro using % include stmt,its throwing error.how should i
succesfully run macro using %include stmt.
i am using the following cmd:to execute macros:
%include postcodetesttrial ' C:\Documents and Settings\admin';
%include postcodetesttrial2 ' C:\Documents and Settings\admin';
macro:
options mautosource;
options SASAUTOS='E:\Homework\Examples';
libname Examples 'E:\Homework\Examples';
options mstored sasmstore=Examples;
LIBNAME DBVYM ORACLE PATH=ORASPO SCHEMA=Vayam USER=vayam
PASSWORD="vayam" ;
%let lib=DBVYM
%macro prepost(job=) / store des='postprocess';
data work.TEMP;
ProcessingDate_D=datetime();
JobName_V=&job;
format ProcessingDate_D dtdate9.;
run;
proc sql;
delete from &lib.ETLTESTJOB WHERE CodeRun<= (((today()*86400))-7) and
Job=&job;
INSERT INTO DBVYM.etltestjob
(Job,CodeRun )
SELECT JobName_V,ProcessingDate_D FROM work.TEMP;
quit;
%mend prepost;
when i run %include stmt its throwing me following error:
87 %include postcodetesttrial ' C:\Documents and Settings\admin';
NOTE: Libref EXAMPLES was successfully assigned as follows:
Engine: V9
Physical Name: E:\Homework\Examples
NOTE: Libref DBVYM was successfully assigned as follows:
Engine: ORACLE
Physical Name: ORASPO
ERROR: Open code statement recursion detected.
97 + ProcessingDate_D=datetime();
----------------
180
ERROR 180-322: Statement is not valid or it is used out of proper order.
WARNING: Apparent symbolic reference JOB not resolved.
98 + JobName_V=&job;
---------
180
ERROR 180-322: Statement is not valid or it is used out of proper order.
99 +format ProcessingDate_D dtdate9.;
------
180
ERROR 180-322: Statement is not valid or it is used out of proper order.
102 +delete from &lib.ETLTESTJOB WHERE CodeRun<= (((today()*86400))-7) and
Job=&job;
-----
22
76
WARNING: Apparent symbolic reference JOB not resolved.
ERROR 22-322: Syntax error, expecting one of the following: ;, !, !!, &, *,
**, +, -, /, <, <=,
<>, =, >, >=, ?, AND, BETWEEN, CONTAINS, EQ, EQT, GE, GET,
GT, GTT, IN, IS, LE,
LET, LIKE, LT, LTT, NE, NET, NOT, NOTIN, OR, ^, ^=, |, ||, ~,
~=.
ERROR 76-322: Syntax error, statement will be ignored.
NOTE: Line generated by the macro variable "LIB".
1 DBVYM data work.TEMPETLTESTJOB
----
79
ERROR 79-322: Expecting a WHERE.
NOTE: 1 row was inserted into DBVYM.ETLTESTJOB.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE SQL used (Total process time):
real time 0.37 seconds
cpu time 0.04 seconds
ERROR: No matching %MACRO statement for this %MEND statement.
ERROR: Invalid file, C:\Documents and Settings\admin.
ERROR: Cannot open %INCLUDE file C:\Documents and Settings\admin.
ERROR: Read Access Violation In Task ( Submit )
Exception occurred at (67866903)
Task Traceback
Address Frame (DBGHELP API Version 4.0 rev 5)
67866903 0317F6E4 0001:00005903 sasxshel.dll
67864DAF 0317F89C 0001:00003DAF sasxshel.dll
678654DC 0317FA50 0001:000044DC sasxshel.dll
678658E1 0317FA7C 0001:000048E1 sasxshel.dll
678832FA 0317FAA8 0001:000222FA sasxshel.dll
678831AB 0317FACC 0001:000221AB sasxshel.dll
678822F4 0317FB48 0001:000212F4 sasxshel.dll
6786E891 0317FB78 0001:0000D891 sasxshel.dll
678720A7 0317FBD0 0001:000110A7 sasxshel.dll
6787AD5D 0317FC0C 0001:00019D5D sasxshel.dll
67878EE6 0317FC88 0001:00017EE6 sasxshel.dll
6789ABD1 0317FD78 0001:00039BD1 sasxshel.dll
678984CD 0317FEE4 0001:000374CD sasxshel.dll
6789712D 0317FF54 0001:0003612D sasxshel.dll
6789A712 0317FF84 0001:00039712 sasxshel.dll
67E223EE 0317FFA0 0001:000113EE sashost.dll
67E26DE0 0317FFB4 0001:00015DE0 sashost.dll
7C80B50B 0317FFEC kernel32:GetModuleFileNameA+0x1B4
ERROR: Generic critical error.
please help me ;
Thanks in Advance
|