|
On 16 May, 13:32, hs AT dc-sug DOT org ("Howard Schreier)" wrote:
> On Fri, 16 May 2008 02:53:56 -0700, beatrice <beatriceghit...@YAHOO.COM> wrote:
> >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?
>
> I think there are actually two impossibilities here. First, a format
> processes a single value, not a pair. Second, if somehow you could get past
> #1, there is no way to associate a format with two variables *and*
> distinguish the "preselect" role from the "match" role.
>
> Can you back up and explain what needs to be accomplished, without
> specifying the tool to be used?- Hide quoted text -
>
> - Show quoted text -
Here is the 'need'.
the variable A is a unique, key variable in the table. Should it
begin with 99 or 98 the format would apply and output OUI. But, this
variable A should only be responsive to the format, if its NOT
variable B (in the same table), that is a numeric indication of a 0 or
1. So, variable B should not be 0.
Is that helpful?
|