Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mend statement missing error

Status
Not open for further replies.

Queryman

Programmer
Nov 4, 2002
243
US
I have a statement at the top of my program like this
%macro MEGAMODEL(CARRID =,CONTRACTID =,GROUPID =,CLIENT =,REPORT_SEGMENT =,
SVCDTE1_PRIOR =,SVCDTE2_PRIOR =,SVCDTE1_CURR =,SVCDTE2_CURR =,INFERRED_FILL =,
EXTERNAL_CLAIMS =);

and the corresponding mend ststement like this at the end of my program
%mend MEGAMODEL;


%MEGAMODEL
(CARRID ='',CONTRACTID ='',GROUPID =('LOF005AH','LOF005AHC','LOF006AH','LOF006AHC','LOF010AH','LOF010AHC','LOF075AH','LOF075AHC'),
CLIENT =PILKINGTON,REPORT_SEGMENT =HOURLY_ACTIVES,SVCDTE1_PRIOR ='2001-01-01',SVCDTE2_PRIOR ='2001-12-31',SVCDTE1_CURR ='2002-01-01',SVCDTE2_CURR ='2002-12-31',
INFERRED_FILL ='Y',EXTERNAL_CLAIMS ='N');

%MEGAMODEL
(CARRID ='',CONTRACTID ='',GROUPID =('LOF005AS','LOF005ASC','LOF006AS','LOF006ASC','LOF010AS','LOF010ASC','LOF075AS','LOF075ASC'),
CLIENT =PILKINGTON,REPORT_SEGMENT =SALARY_ACTIVES,SVCDTE1_PRIOR ='2001-01-01',SVCDTE2_PRIOR ='2001-12-31',SVCDTE1_CURR ='2002-01-01',SVCDTE2_CURR ='2002-12-31',
INFERRED_FILL ='Y',EXTERNAL_CLAIMS ='N');


I keep getting a message like this when I run this program
WARNING: Missing %MEND statement.

Any ideas?
Thanks!


QueryMan

 
Hi QueryMan,

in v8 it ran just fine - I assume you are using that. I put a dummy datastep in and dumped a few vars from the call, fine.

In 6.12 it does not work since the names are not compliant / too long. Do you have a bit more information what is in the macro actually, or did you solve it already?

Cheers,
Matthias
 
I am using version 8.2, I have a lot of other programs that work when coded in this manner but not this one. The macro values are

%MEGAMODEL
(CARRID ='',CONTRACTID ='',GROUPID =('LOF005AH','LOF005AHC','LOF006AH','LOF006AHC','LOF010AH','LOF010AHC','LOF075AH','LOF075AHC'),
CLIENT =PILKINGTON,REPORT_SEGMENT =HOURLY_ACTIVES,SVCDTE1_PRIOR ='2001-01-01',SVCDTE2_PRIOR ='2001-12-31',SVCDTE1_CURR ='2002-01-01',SVCDTE2_CURR ='2002-12-31',
INFERRED_FILL ='Y',EXTERNAL_CLAIMS ='N');

%MEGAMODEL
(CARRID ='',CONTRACTID ='',GROUPID =('LOF005AS','LOF005ASC','LOF006AS','LOF006ASC','LOF010AS','LOF010ASC','LOF075AS','LOF075ASC'),
CLIENT =PILKINGTON,REPORT_SEGMENT =SALARY_ACTIVES,SVCDTE1_PRIOR ='2001-01-01',SVCDTE2_PRIOR ='2001-12-31',SVCDTE1_CURR ='2002-01-01',SVCDTE2_CURR ='2002-12-31',
INFERRED_FILL ='Y',EXTERNAL_CLAIMS ='N');

QueryMan

 
Hi QueryMan,

I exactly ran your macro call, just that I had the macro, since not supplied, replaced with a parameter dump - here's the log:

Code:
23   %macro MEGAMODEL(CARRID =,CONTRACTID =,GROUPID =,CLIENT =,REPORT_SEGMENT =,

24   SVCDTE1_PRIOR =,SVCDTE2_PRIOR =,SVCDTE1_CURR =,SVCDTE2_CURR =,INFERRED_FILL =,

25   EXTERNAL_CLAIMS =);
26
27     data _null_;
28        put 'Variable Dump:';
29        put "&CARRID., &CONTRACTID., &GROUPID., &CLIENT., &REPORT_SEGMENT.";
30        put "&SVCDTE1_PRIOR., &SVCDTE2_PRIOR., &SVCDTE1_CURR. ";
31        put "&SVCDTE2_CURR., &INFERRED_FILL., &EXTERNAL_CLAIMS.";
32     run;
33
34   %mend MEGAMODEL;
35
36   %MEGAMODEL
37   (CARRID ='',CONTRACTID ='',GROUPID
37 ! =('LOF005AH','LOF005AHC','LOF006AH','LOF006AHC','LOF010AH','LOF010AHC','LOF075AH','LOF075AHC
37 ! '),
38   CLIENT =PILKINGTON,REPORT_SEGMENT =HOURLY_ACTIVES,SVCDTE1_PRIOR ='2001-01-01',SVCDTE2_PRIOR
38 ! ='2001-12-31',SVCDTE1_CURR ='2002-01-01',SVCDTE2_CURR ='2002-12-31',
39   INFERRED_FILL ='Y',EXTERNAL_CLAIMS ='N');

Variable Dump:
'', '', ('LOF005AH','LOF005AHC','LOF006AH','LOF006AHC','LOF010AH','LOF010AHC','LOF075AH','LOF075A
HC'), PILKINGTON, HOURLY_ACTIVES
'2001-01-01', '2001-12-31', '2002-01-01'
'2002-12-31', 'Y', 'N'
NOTE: DATA statement used:
      real time           0.01 seconds
      cpu time            0.01 seconds


40
41   %MEGAMODEL
42   (CARRID ='',CONTRACTID ='',GROUPID
42 ! =('LOF005AS','LOF005ASC','LOF006AS','LOF006ASC','LOF010AS','LOF010ASC','LOF075AS','LOF075ASC
42 ! '),
43   CLIENT =PILKINGTON,REPORT_SEGMENT =SALARY_ACTIVES,SVCDTE1_PRIOR ='2001-01-01',SVCDTE2_PRIOR
43 ! ='2001-12-31',SVCDTE1_CURR ='2002-01-01',SVCDTE2_CURR ='2002-12-31',
44   INFERRED_FILL ='Y',EXTERNAL_CLAIMS ='N');

Variable Dump:
'', '', ('LOF005AS','LOF005ASC','LOF006AS','LOF006ASC','LOF010AS','LOF010ASC','LOF075AS','LOF075A
SC'), PILKINGTON, SALARY_ACTIVES
'2001-01-01', '2001-12-31', '2002-01-01'
'2002-12-31', 'Y', 'N'
NOTE: DATA statement used:
      real time           0.00 seconds
      cpu time            0.00 seconds

There could be something in your macro itself that is suspicious. Can you supply that one? Can you compile it multiple times in a row without error?

Also, all your parameters are quoted, that could be double effort to quote initially then unquote when using. You should consider not quoting them at all:

Code:
45   %MEGAMODEL
46   (CARRID=,CONTRACTID=,GROUPID
46 ! =(LOF005AS,LOF005ASC,LOF006AS,LOF006ASC,LOF010AS,LOF010ASC,LOF075AS,LOF075ASC),

47   CLIENT =PILKINGTON,REPORT_SEGMENT =SALARY_ACTIVES,SVCDTE1_PRIOR =2001-01-01,SVCDTE2_PRIOR
47 ! =2001-12-31,SVCDTE1_CURR =2002-01-01,SVCDTE2_CURR =2002-12-31,
48   INFERRED_FILL =Y,EXTERNAL_CLAIMS =N);

Variable Dump:
, , (LOF005AS,LOF005ASC,LOF006AS,LOF006ASC,LOF010AS,LOF010ASC,LOF075AS,LOF075ASC), PILKINGTON, SA
LARY_ACTIVES
2001-01-01, 2001-12-31, 2002-01-01
2002-12-31, Y, N
NOTE: DATA statement used:
      real time           0.01 seconds
      cpu time            0.01 seconds

Cheers,
Matthias
 
Mathias, I figured this out, I had a commented field in my macro that apparently was not commented properly. Thanks for your help.

QueryMan

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top