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 (June 2009, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 3 Jun 2009 03:10:00 -0700
Reply-To:     RolandRB <rolandberry@HOTMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         RolandRB <rolandberry@HOTMAIL.COM>
Organization: http://groups.google.com
Subject:      Re: How to check for a binary number?
Comments: To: sas-l@uga.edu
Content-Type: text/plain; charset=ISO-8859-1

On 3 Jun., 11:28, Amar Mundankar <amarmundan...@gmail.com> wrote: > Hi all, > I want the user should pass only a binary value (e.g, 11001, 100011) > to a macro function. How can we check that whether the value passed is > in Binary format or not? > > e.g. > %macro IsBin(val); > /* > some sas code here to check whether the &val is binary or not. > */ > %mend IsBin; > > Regards, > Amar Mundankar.

%macro IsBin(val); %if %quote(%sysfunc(compress(&val,01))) NE %then %put >>>> Not binary >>>; %else %put >>> Is binary >>>>; %mend IsBin;

%IsBin(1001);


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