f



Re: if str_mo not in ('','.') and str_da not in ('','.') and str_yy not in ('','.') Any shorter ? #2

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
0
paul_dorfman (183)
10/23/2003 7:50:05 PM
comp.soft-sys.sas 142828 articles. 3 followers. Post Follow

0 Replies
1859 Views

Similar Articles

[PageSpeed] 13

Reply:

Similar Artilces:

if str_mo not in ('','.') and str_da not in ('','.') and str_yy not in ('','.') Any shorter ?
Hi, there. =20 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 ('','.')=20 =20 Igor Kurbeko Clinical Programmer Analyst 678 336 4328 ikurbeko@atherogenics.com =20 no brain no pain =20 how about: if not (str_mo in ('','.') or str_da in ('','.') or str_yy in ('','.')) OR if not (missing(str_mo) or missing(str_da) or missing(str_yy)) Eric On 22 Oct 03 21:13:37 GMT, ikurbeko@ATHER...

Re: if str_mo not in ('','.') and str_da not in ('','.') and str_yy not in ('','.') Any shorter ?
OR you could use ARRAY data new; set old; array igor $ (*) str_mo str_da str_yr; do over igor; if igor ~in (' ','.') then do; end; run; Prasad Ravi Igor Kurbeko <ikurbeko@ATHEROGENIC To: SAS-L@LISTSERV.UGA.EDU S.COM> cc: Sent by: "SAS(r) Subject: if str_mo not in ('','.') and str_da not in ('','.') and str_yy ...

'^=' and '~='?
Hello, What is the difference between '^=' and '~='? Thanks, Duckhye ...

'is not' or '!='
A newbie question to you; what is the difference between statements like: if x is not None: and if x != None: Without any context, which one should be preferred? IMHO, the latter is more readable. On 2014-08-18 21:35, ElChino wrote: > A newbie question to you; what is the difference between statements > like: > if x is not None: > and > if x != None: > > Without any context, which one should be preferred? > IMHO, the latter is more readable. > "x == y" tells you whether x and y refer to objects that are equal. "x is y&qu...

Re: if str_mo not in ('','.') and str_da not in ('','.') and str_ yy not in ('','.') Any shorter ? #2
I believe nmiss requires numeric arguments, therefore it would not work in this case. Greg M. Woolridge Manager, Study Programming TAP Pharmaceutical Products Inc. e-mail: greg.woolridge@tap.com phone: 847-582-2332 fax: 847-582-2403 "Droogendyk, Harry" To: SAS-L@LISTSERV.UGA.EDU <Harry.Droogendy cc: k@CIBC.COM> Subject: Re: if str_mo not in ('','.') and str_da not in ('','.') and str_ Sent...

Re: if str_mo not in ('','.') and str_da not in ('','.') and str_ yy not in ('','.') Any shorter ?
Igor: Are you really looking for missing values? If so, use the "nmiss" function. It returns the number of missing values in the supplied variables. e.g. if nmiss(str_mo,str_da,str_yy) then put 'Have missing values'; -----Original Message----- From: Igor Kurbeko [mailto:ikurbeko@ATHEROGENICS.COM] Sent: Wednesday, October 22, 2003 5:14 PM To: SAS-L@LISTSERV.UGA.EDU Subject: if str_mo not in ('','.') and str_da not in ('','.') and str_yy not in (&#...

Re: if str_mo not in ('','.') and str_da not in ('','.') and str_ yy not in ('','.') Any shorter ? #3
> From: Igor Kurbeko [mailto:ikurbeko@ATHEROGENICS.COM] > 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 ('','.') %*in autoexec:; %Let Blank = Blank; %Let Invalid = Invalid; %*in aFormat; PROC Format; value $StrValu %*somevalues = 'ok'; '','.' = "&Blank." %* other = "&Invalid."; ; %*in Program; if put(Str_...

Re: if str_mo not in ('','.') and str_da not in ('','.') and str_ yy not in ('','.') Any shorter ? #4
Igor, Without robust error checking: %macro check ( vars , values , op = in /* not in */, con = and /* or */ ) ; %local i w ; %let i = 1 ; %let w = %scan(&vars,&i) ; %do %while ( %length ( &w ) > 0 ) ; %if &i > 1 %then &con ; &w &op &values %let i = %eval ( &i + 1 ) ; %let w = %scan(&vars,&i) ; %end ; %mend check ; option mprint ; data w ; retain x y z "a" r " " s t "a" a b 99 c . ; if %check( x y z , ('','.'), op = not in ) then put &qu...

'''''''''''''The Running Update/Append Queries Using VBA code Ordeal'''''''''''''' #2
Hi, Thanks for ur help there HJ. I know how to do the tasks you specified there. I would like for the update query to use field values from some of the fields on the form (frmInvoices) such as InvoiceNumber, DateFrom, DateTo. My problem is that an append/update query can't find the values in the open Form (frmInvoices) when I specify them as; [Forms]![frmInvoices]![InvoiceNumber] a select query has no problem finding the field values on a form. please help. Aaron Hi Aaron, Could you post the entire code that you are having trouble with? Now it is not possible to see what goes wron...

'''''''''''''The Running Update/Append Queries Using VBA code Ordeal''''''''''''''
Hello fellow programmers, I am trying to run an append/update query from code, a command button on a form initiates the queries. the format i am using is; _____________________________________________________ SELECT "criteria" FROM "criteria" WHERE "criteria" UPDATE/APPEND "field selections" RecordSource "qryExample" = above text strings" _______________________________________________________________________ When i am running a SELECT query in this manner it works fine with no problems, and accepts the values of specified linked for...

Re: '^=' and '~='?
Duckhye, According to the doc ( http://xrl.us/befwjx ) they, and one other set of characters, and the mnemonic 'NE' all represent 'NOT EQUAL'. Art ------- On Wed, 11 Feb 2009 16:52:40 -0600, Duck-Hye Yang <dyang@CHAPINHALL.ORG> wrote: >Hello, >What is the difference between '^=' and '~='? > >Thanks, >Duckhye ...

A function with 'and' , 'not' , 'null' , 'car' and 'cdr'
What's this ? (defun enigma (x) (and (not (null x)) (or (null (car x)) (enigma (cdr x))))) "I suppose I should learn Lisp, but it seems so foreign." - Paul Graham, Nov 1983 On Wed, Oct 07 2015, CAI GENGYANG wrote: > What's this ? > > > (defun enigma (x) > (and (not (null x)) > (or (null (car x)) > (enigma (cdr x))))) Bad taste? It returns T if the list X contains nil as an element. It would be clearer to write (some #'null x). Helmut CAI GENGYANG ...

error: expected '=', ',', ';', 'asm' or '__attrib
Hi I'm trying to compile an ADC Driver & come acrosss the following error. I've no experience writing drivers before, and hence have no clue how to fix it. Hope someone out there has encountered the problem & suggesst a fix for the same. The Error is I get is : qadc.c: At top level: qadc.c:97: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'qadc_read' make: *** [qadc.o] Error 1 [root@localhost qadc]# ########################################################################### ADC Driver Code ####################...

error: expected '=', ',', ';', 'asm' or '__attrib
Hi I'm trying to compile an ADC Driver & come acrosss the following error. I've no experience writing drivers before, and hence have no clue how to fix it. Hope someone out there has encountered the problem & suggesst a fix for the same. The Error is I get is : qadc.c: At top level: qadc.c:97: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'qadc_read' make: *** [qadc.o] Error 1 [root@localhost qadc]# ########################################################################### ADC Driver Code ##...

Web resources about - Re: if str_mo not in ('','.') and str_da not in ('','.') and str_yy not in ('','.') Any shorter ? #2 - comp.soft-sys.sas

Resources last updated: 1/28/2016 10:55:56 PM