Date: Fri, 30 Dec 2011 07:07:22 -0500
Reply-To: Lizette Koehler <starsoul@mindspring.com>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Lizette Koehler <starsoul@MINDSPRING.COM>
Subject: Re: Help with NO Observations
Content-Type: text/plain; charset=UTF-8
I have worked some more with this code and determined the best option is to OUTPUT a single record at the beginning of my filtering process. That was I always have at least one observation.
Then when I get to the EMAIL section, I then check to see if I have only one Observation. If I do then I just put out the "NO WTORS FOUND" notice.
If there is a better way to do this let me know, but I think this is the only solution I could find.
Thanks for helping me to understand the SET and NOOBS situation better.
Lizette
-----Original Message-----
>From: Lizette Koehler <starsoul@mindspring.com>
>Sent: Dec 27, 2011 10:50 AM
>To: Newsgroup SAS <SAS-L@LISTSERV.UGA.EDU>
>Subject: Help with NO Observations
>
>
>under z/OS V1.11 with Sas 9.1.3
>
>I have a little sas program that reads syslog (or a text file).
>
>I need to PUT a line like PUT "NO ENTRIES FOUND" ;
>If the scan does not produce any data.
>
>So on my SET statement I have
>
>SET MYFILE NOBS=MYOBS END=MYEND ;
>
>Yet I am not sure why I am not producing the results I want.
>
>I have the following coded:
>
>FILENAME MYMAIL EMAIL ;
>DATA _NULL_;
>SET WTOCHECK nobs=myobs end = myend ;
> FILE MYMAIL
> SUBJECT='DAILY REPORT ON OUTSTANDING WTORS '
> TO=('myuser@mycompany.COM'
> ) ;
> IF _N_ LE 1 THEN
> DO ;
> PUT ' ' ;
> put ' Here is/are WTORs that were pending for over '
> '5 minsutes for the last '
> ' 24 hours. Please review ' ;
> PUT ' ';
> PUT ' ';
> PUT ' ';
> END ;
> If myobs > 0 or myend > 0 Then
> Do ;
> IF MISSING(MYDATE) THEN DELETE ;
> T1 = FIND(LINE1,'OPS3092H') ;
> T2 = FIND(LINE1,'OPS3900O') ;
> T3 = FIND(LINE1,'OPS1370H') ;
> IF T1 > 0 OR T2 > 0 OR T3 > 0 THEN DELETE ;
> PUT @02 SYSID +3
> MYDATE DATE. +3
> MYTIME TIME10. +3
> LINE1
> ;
> End ;
> Else put "No WTORs found at this time" ;
> RUN;
>
>Yet, no matter how I test for the myobs or myend it does not produce the results I want.
>
>I would like the IF _N_ = 1 PUT statements to be produced whether I have observations or not.
>I would like the phrase " NO WTORS FOUND" if there are no observations.
>
>Any guidance on what I can set or code that will tell me if there are zero observations so I can put an alternate line of information.
>
>Thanks
>
>Lizette
>
>
|