Steve and others:

This is the way I currently do this (by the way this is not a real 
life example, but I have a few):

SELECT +
  (IFEQ(title,'Mrs','Female', +
  IFEQ(title,'Ms','Female', +
  IFEQ(title,'Miss','Female', +
  ,'Male')))) +
FROM tableview

It works fine until the list gets too long or when including SRPL's 
to get rid of periods(ex. Mrs.) or other needed functions, etc..  
When it's too long  the select clause bombs saying the expression is 
too long and can't be executed.  I just thought the IFIN idea might 
shorten the expression.

Hadn't thought of the stored procedure route and haven't done much 
with them yet, but I'll look into it.

Thanks for the ideas.

Duey


From:                   "J. Stephen Wills" <[EMAIL PROTECTED]>
To:                     <[EMAIL PROTECTED]>
Subject:                Re: IFIN function possibility
Date sent:              Mon, 25 Nov 2002 15:22:39 -0600
Organization:           Bureau of Business & Economic Research
Send reply to:          [EMAIL PROTECTED]

> Duey, couldn't you build a list, using something like :
> 
> SELECT +
>   LISTOF(Prefixes) +
> INTO +
>   vFemalePrefixes IND vFPi +
> FROM +
>   PREFIX_TABLE +
> WHERE +
>   DefaultGender="Female"
> 
> SELECT +
>   LISTOF(Prefixes) +
> INTO +
>   vMalePrefixes IND vFPi +
> FROM +
>   PREFIX_TABLE +
> WHERE +
>   DefaultGender="Male"
> 
> -- `PREFIX`, here, may be interchangeable w/`TITLE`
> 
> as part of a startup routine - since this list will (should) rarely
> change within a session, perhaps even years, the value-list is
> virtually static. Then, you could use, say :
> 
> --Assumes that all quote settings are kosher
> IF vPrefix IN (&vFemalePrefixes) THEN
>    SET VAR vGender="FEMALE"
> ELSE
>    IF  vPrefix IN (&vMalePrefixes) THEN
>       SET VAR vGender="MALE"
>    ELSE
>       SET VAR vGender="AMBIGUOUS"
>    ENDIF
> ENDIF
> 
> whether it's in a command file or in a stored proc.
> 
> Some of the other folks might come up w/better ideas, but maybe
> this'll help.
> 
> Later,
> Steve in Memphis
> 
> ----- Original Message -----
> From: "Duey Heffelfinger" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, November 25, 2002 1:32 PM
> Subject: IFIN function possibility
> 
> 
> > Good Morning,
> >
> > Unfortunately I haven't had time to be a beta tester for the new
> > versions, but I do have a function request that might help someone
> > beyond just me.  If you are a beta tester and would find it useful
> > would you please submit the idea for me?  Thanks!  Here's the
> > function:
> >
> >  If arg1 is IN arg2list return arg3, otherwise return arg4.
> >  (IFIN(arg1,arg2list,arg3,arg4))
> >
> > This could easily be used in a select statement for example:
> >
> > SELECT (IFIN(title,'Mrs,Ms,Miss','Female','Male')) +
> >   FROM tableview
> >
> > Would display Male or Female based on the IFIN list.  Otherwise you
> > have to use 3 IFEQ functions to accomplish the same thing.
> > Occasionally my statements have gone over the limit, so I end up
> > looking for creative ways to accomplish this type of statement.
> >
> > Duey
> > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> > +        Duey Heffelfinger, Director of Computer Services
> > +
> > + E-mail: [EMAIL PROTECTED]               Dana College
> > +
> > + Phone : 402-426-7289                        2848 College Drive
> > +
> > +                                   Blair, Nebraska  68008
> > +
> > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> > + If you can dream it, it can come true!
> > +
> > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> >
> > ================================================
> > TO SEE MESSAGE POSTING GUIDELINES:
> > Send a plain text email to [EMAIL PROTECTED]
> > In the message body, put just two words: INTRO rbase-l
> > ================================================
> > TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED]
> > In the message body, put just two words: UNSUBSCRIBE rbase-l
> > ================================================ TO SEARCH ARCHIVES:
> > http://www.mail-archive.com/rbase-l%40sonetmail.com/
> 
> ================================================
> TO SEE MESSAGE POSTING GUIDELINES:
> Send a plain text email to [EMAIL PROTECTED]
> In the message body, put just two words: INTRO rbase-l
> ================================================
> TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED] In
> the message body, put just two words: UNSUBSCRIBE rbase-l
> ================================================ TO SEARCH ARCHIVES:
> http://www.mail-archive.com/rbase-l%40sonetmail.com/

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+        Duey Heffelfinger, Director of Computer Services            
+
+ E-mail: [EMAIL PROTECTED]               Dana College           
+
+ Phone : 402-426-7289                        2848 College Drive     
+
+                                             Blair, Nebraska  68008 
+
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ If you can dream it, it can come true!                             
+
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

================================================
TO SEE MESSAGE POSTING GUIDELINES:
Send a plain text email to [EMAIL PROTECTED]
In the message body, put just two words: INTRO rbase-l
================================================
TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED]
In the message body, put just two words: UNSUBSCRIBE rbase-l
================================================
TO SEARCH ARCHIVES:
http://www.mail-archive.com/rbase-l%40sonetmail.com/

Reply via email to