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 (May 2008, 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 May 2008 02:53:56 -0700
Reply-To:     beatrice <beatriceghitoiu@YAHOO.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         beatrice <beatriceghitoiu@YAHOO.COM>
Organization: http://groups.google.com
Subject:      Re: Formats based on multiple variable conditions
Comments: To: sas-l@uga.edu
Content-Type: text/plain; charset=ISO-8859-1

On 15 May, 17:29, j...@stanfordalumni.org (Jack Hamilton) wrote: > Yes, but the expression will become unwieldy if the the first character > can be any of the 90+ printable characters on a standard US-English > keyboard. > > On Thu, 15 May 2008 12:01:42 -0400, "Howard Schreier <hs AT dc-sug DOT > org>" <schreier.junk.m...@GMAIL.COM> said: > > > > > > > On Thu, 15 May 2008 08:27:04 -0700, Jack Hamilton > > <j...@STANFORDALUMNI.ORG> > > wrote: > > > >You could pass the concatenation of two variables to a format using the > > >PUT (or INPUT) function. In your case, you might need something like > > > > put(substr(var1, 1, 1) || var2, $myformat.) > > > >If course, this can only be used where SAS allows an expression (so not, > > >for example, in the PUT statement). > > > But in a context which accepts an expression, the expression can do the > > whole job, as in > > > result = ifc( substr(x,1,1) in ('y','e','s') and not y > > , 'OUI' > > , ' '); > > > >On Thu, 15 May 2008 07:53:21 -0700, "beatrice" > > ><beatriceghit...@YAHOO.COM> said: > > >> On 14 May, 17:47, hs AT dc-sug DOT org ("Howard Schreier)" wrote: > > >> > On Wed, 14 May 2008 07:00:34 -0700, beatrice > > <beatriceghit...@YAHOO.COM> wrote: > > >> > >Hi all, > > > >> > >im trying to set up a format in SAS DI whereby based on the first > > >> > >character of variable x and the negation of variable y, the format > > >> > >output OUI as its output. Is this possible? > > > >> > A format is an attribute of a variable (singular, not plural). The > > >> > requirement here seems more appropriate for a function. > > > >> Thank you for your response. Much appreciated. I did susspect that > > >> this would not be possible. Is there anyway around this related to a > > >> format in some way or another? > > > >-- > > >Jack Hamilton > > >Sacramento, California > > >j...@alumni.stanford.org <== Use this, not j...@stanfordalumni.org > > -- > Jack Hamilton > Sacramento, California > j...@alumni.stanford.org <== Use this, not j...@stanfordalumni.org- Hide quoted text - > > - Show quoted text -

I appreaciate the effort you have all put in very much. This format is going to be used by a bunch of analysts, so I dont think that I could expect them to have this level of SAS. In anyevent, all the other fomats we have done for them are simple straight and forward. Is there anyway the format could preselect or extract based on the negation of variable 2 and then match anyrecords to that subset, then return as the needed output? what kind of processing efforst would this condume?


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