LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (March 2007, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Fri, 16 Mar 2007 03:31:19 -0400
Reply-To:   Gerhard Hellriegel <gerhard.hellriegel@T-ONLINE.DE>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Gerhard Hellriegel <gerhard.hellriegel@T-ONLINE.DE>
Subject:   Re: macros question

I don't understand, how your contitions are built, but if the problem is to separate the two numbers in condition3:

%macro a; %let value3=12345, 67891; %let part1=%scan(%quote(&value3),1); %let part2=%scan(%quote(&value3),2); %put Part1 &part1; %put Part2 &part2; %mend; %a;

Hope that helps! Gerhard

On Thu, 15 Mar 2007 21:59:44 -0400, mesecca L katram <mesecca@YAHOO.COM> wrote:

>I have a situation where I need to create 3 conditional if loop in side a macro >the possible values are (please note these parameters are submitted by users ) >condition 1:-10 0 1 2 3 4 >condition 2:10227 >condition 3:10227, 57879 > >the macro resolves fine for the first 2 conditions work fine with following code >but for the condition 3 I cannot use %eval as it is commaseparated, >which macro function can I use which resolves for all the 3 conditions. >options symbolgen; >*%let vallue2=-10 >%let value2=10227; >%macro getdata; >/*condition1*/ >%if %eval(&value2) <= 4 and %length(&value2) >=12 %then %do; >data x1;x=1;run; >%end; >/*condition2*/ >%if %eval(&value2) > 4 or %length(&value2) >=12%then %do; >data x2;x=2;run; >%end; >%mend; >%getdata >run;


Back to: Top of message | Previous page | Main SAS-L page