BookmarkSubscribeRSS Feed
yhc_90
Calcite | Level 5

I'm having issues when using the macro %INCLUDE. I'm trying to score a dataset using the SAS code generated from SAS EM (decision tree). I can run the code fine for 10 trees, but two of them give me: ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, a numeric constant, a datetime constant,  a missing value, arrayname, (, +, -, INPUT, NOT, PUT, ^, _NEW_, ~. .

 

Here's my code:

DATA Score; 
		SET TREE.score;
		%INCLUDE "/data/tree1_score.sas";
run;

Here's the log file:

22         GOPTIONS ACCESSIBLE;
23         	* Score data;
24         		
24       !   DATA Score;
25         		SET TREE.score;
26         		     %INCLUDE "/data/tree1_score.sas";
MLOGIC(DMNORMIP):  Beginning execution.
MLOGIC(DMNORMIP):  This macro was compiled from the autocall file /usr/local/sas/SASHome/SASFoundation/9.4/sasautos/dmnormip.sas
MLOGIC(DMNORMIP):  Parameter IN has value _ARBFMT_12
SYMBOLGEN:  Macro variable IN resolves to _ARBFMT_12
MPRINT(DMNORMIP):   call dmnorm(_ARBFMT_12,
MLOGIC(DMNORLEN):  Beginning execution.
MLOGIC(DMNORLEN):  This macro was compiled from the autocall file /usr/local/sas/SASHome/SASFoundation/9.4/sasautos/dmnorlen.sas
MPRINT(DMNORLEN):  32
MLOGIC(DMNORLEN):  Ending execution.
MPRINT(DMNORMIP):  );
MLOGIC(DMNORMIP):  Ending execution.
MLOGIC(DMNORMIP):  Beginning execution.
MLOGIC(DMNORMIP):  This macro was compiled from the autocall file /usr/local/sas/SASHome/SASFoundation/9.4/sasautos/dmnormip.sas
MLOGIC(DMNORMIP):  Parameter IN has value _ARBFMT_12
SYMBOLGEN:  Macro variable IN resolves to _ARBFMT_12
MPRINT(DMNORMIP):   call dmnorm(_ARBFMT_12,
MLOGIC(DMNORLEN):  Beginning execution.
MLOGIC(DMNORLEN):  This macro was compiled from the autocall file /usr/local/sas/SASHome/SASFoundation/9.4/sasautos/dmnorlen.sas
MPRINT(DMNORLEN):  32
MLOGIC(DMNORLEN):  Ending execution.
MPRINT(DMNORMIP):  );
MLOGIC(DMNORMIP):  Ending execution.
1027      +*****************************************************************************************
           __
           22
           76
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, a numeric constant, a datetime constant, 
              a missing value, arrayname, (, +, -, INPUT, NOT, PUT, ^, _NEW_, ~.  

If I change the file to something else, it works just fine. Only two SAS files are problematic.

 

1 REPLY 1
ballardw
Super User

%include isn't actually macro code, more of a directive.

 

Since you say the issue is with two levels of your process then the issue seems to be with your data. You have not include the details of any of the code actually needed that is from the source or autocall macros so it's going to be hard to make suggestions other than your data may be missing something that is expected.

 

You may need to add options Mprintnest source2 to get more details in the log.

 

Subset your data to one of those cases, look at all of the macros called for required parameters and determine if you can fine one or more of them missing from your data.

sas-innovate-2024.png

Today is the last day to save with the early bird rate! Register today for just $695 - $100 off the standard rate.

 

Plus, pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 1 reply
  • 688 views
  • 0 likes
  • 2 in conversation