BookmarkSubscribeRSS Feed
ashwini2
Fluorite | Level 6
options mprint;
 %MACRO V22I9ED1(AGE=, SEX=, ICD9= );

   IF &SEX= "2" AND &ICD9 IN ("2860", "2861")  THEN CC=" 48 "; 
   ELSe IF &AGE < 18 AND &ICD9 IN ("4910", "4911", "49120", "49121", "49122",
                              "4918", "4919", "4920", "4928", "496",  
                              "5181", "5182") THEN CC=" 112 ";
   ELSE IF &AGE < 18 AND &ICD9 IN ("49320", "49321", "49322") 
                                              THEN CC=" -1 ";

 
%IF &SEDITS = 1 %THEN %DO;
    
     _TAGE=PUT(&ICD9, $&AGEFMT9..);
     IF _TAGE NE "-1" AND
        (&AGE < INPUT(PUT(_TAGE, $AGEL.),8.) OR
         &AGE > INPUT(PUT(_TAGE, $AGEU.),8.)) THEN CC='-1';

    
     _TSEX=PUT(&ICD9, $&SEXFMT9..);
     IF _TSEX NE "-1"  & _TSEX NE &SEX THEN CC='-1';

  %END;
 %MEND V22I9ED1;

Error is attached below: Could somebody please help me with it?

 

Capture.PNG

3 REPLIES 3
ashwini2
Fluorite | Level 6
options mprint;
 %MACRO V22I9ED1(AGE=, SEX=, ICD9= );

   IF &SEX= "2" AND &ICD9 IN ("2860", "2861")  THEN CC=" 48 "; 
   ELSe IF &AGE < 18 AND &ICD9 IN ("4910", "4911", "49120", "49121", "49122",
                              "4918", "4919", "4920", "4928", "496",  
                              "5181", "5182") THEN CC=" 112 ";
   ELSE IF &AGE < 18 AND &ICD9 IN ("49320", "49321", "49322") 
                                              THEN CC=" -1 ";

 
%IF &SEDITS = 1 %THEN %DO;
    
     _TAGE=PUT(&ICD9, $&AGEFMT9..);
     IF _TAGE NE "-1" AND
        (&AGE < INPUT(PUT(_TAGE, $AGEL.),8.) OR
         &AGE > INPUT(PUT(_TAGE, $AGEU.),8.)) THEN CC='-1';

    
     _TSEX=PUT(&ICD9, $&SEXFMT9..);
     IF _TSEX NE "-1"  & _TSEX NE &SEX THEN CC='-1';

  %END;
 %MEND V22I9ED1;

Attached is the error message


Capture.PNG
Reeza
Super User

You  need to post more of your log, specifically, how are you calling the macro.

 

 

ballardw
Super User

And run the code with OPTIONS MPRINT;

Many times the displayed error message is way after the line of code with the issue and MPRINT helps with that plus showing the resolved values of the macro code.

 

 

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

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

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 857 views
  • 0 likes
  • 3 in conversation