Date: Thu, 23 Oct 2003 19:50:05 +0000
Reply-To: sashole@bellsouth.net
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Paul Dorfman <paul_dorfman@HOTMAIL.COM>
Subject: Re: if str_mo not in ('','.') and str_da not in ('','.') and
str_yy not in ('','.') Any shorter ?
Content-Type: text/plain; format=flowed
Igor,
There are many ways to make it more concise, however the parsimony is likely
to be achieved at the expense of clarity. For instance, the expressions
length ( input (mm||dd||yy, $10.) ) > 2
length ( compress(mm||dd||yy, ' .') ) > 2
and like might be somewhat shorter than the original, but they will execute
slower, and their intent is far less eminent. Since it appears that you are
trying to validate the components of a date, maybe it is not a worthless
idea to try the date informat conforming to the mask you are testing. Say if
all the pieces are 2-digit, the expression
input (mm||dd||yy, ?? mmddyy6.)
will return a missing value for the case you are testing and also if any
irregularities in the input value that prevent it from being interpreted as
a valid date should be found. And if you want a note in the log to alert you
about it, leave one of the question marks off.
Kind regards,
=================
Paul M. Dorfman
Jacksonville, FL
=================
>From: Igor Kurbeko <ikurbeko@ATHEROGENICS.COM>
>Reply-To: Igor Kurbeko <ikurbeko@ATHEROGENICS.COM>
>To: SAS-L@LISTSERV.UGA.EDU
>Subject: if str_mo not in ('','.') and str_da not in ('','.') and str_yy
> not in ('','.') Any shorter ?
>Date: Wed, 22 Oct 2003 17:13:37 -0400
>
>Hi, there.
>
>
>
>I'm just curious if it ever dawned on anybody how to abbreviate this
>line :
>
>if str_mo not in ('','.') and str_da not in ('','.') and str_yy not in
>('','.')
>
>
>
>Igor Kurbeko
>
>Clinical Programmer Analyst
>
>678 336 4328
>
>ikurbeko@atherogenics.com
>
>
>
>no brain no pain
>
>
_________________________________________________________________
Enjoy MSN 8 patented spam control and more with MSN 8 Dial-up Internet
Service. Try it FREE for one month! http://join.msn.com/?page=dept/dialup
|