BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
grezek
Obsidian | Level 7

In a gplot within a macro, I'm trying to force the placement of the legend in the upper right hand portion of a graph, if a couple of the inputs meet certain criteria. In the first line I've  written the statement to place the legent in the lower left hand portion and want to override that statement when the conditions are met and the %if statement is true.

 

One problem I see right off the bat:  I don't know the syntax of the in statement in a macro.

 

legend1 frame shape=symbol(4,2) position=(bottom left inside) mode=reserve label=('') across=1 down=5;

%if &&&invar&k.. = fico and &&&gvar&i.. in (exp_fix_P_Pay , exp_M_EL) %then

legend1 frame shape=symbol(4,2) position=(top right inside) mode=reserve label=('') across=1 down=5;

 

Simplifying the condition to %if &&&invar&k.. = fico somehow messed the subsequent plot statements.

 

Any suggestions as to how to set up the condition are welcome. 

 

Thank you -- George

1 ACCEPTED SOLUTION

Accepted Solutions
Jagadishkatam
Amethyst | Level 16

You need to use the option minoperator along with the mindelimiter. Please check below code for example

 

options minoperator mlogic;
%macro test(value) / mindelimiter=',';

   %if &value in 1,2,3,4,5,6 %then 
       %put Value found within list.;
   %else %put Value not in list.;

%mend;

%test(3)

 

Thanks,
Jag

View solution in original post

2 REPLIES 2
Jagadishkatam
Amethyst | Level 16

You need to use the option minoperator along with the mindelimiter. Please check below code for example

 

options minoperator mlogic;
%macro test(value) / mindelimiter=',';

   %if &value in 1,2,3,4,5,6 %then 
       %put Value found within list.;
   %else %put Value not in list.;

%mend;

%test(3)

 

Thanks,
Jag
grezek
Obsidian | Level 7

You gave me what I needed to know.  I don't remember seeing "minoperator" nor "mindelimiter" and doubt that I would have found that on my own.  Thank you very much for your help! -- George

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
  • 2 replies
  • 745 views
  • 0 likes
  • 2 in conversation