Date: Thu, 14 May 2009 18:17:00 -0700
Reply-To: EVANTRA <EDMOND.VANBEBBER@DTS.CA.GOV>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: EVANTRA <EDMOND.VANBEBBER@DTS.CA.GOV>
Subject: Re: Grap variable if condition one row down is met
Content-Type: text/plain; charset=ISO-8859-1
On May 14, 3:17 pm, art...@NETSCAPE.NET (Arthur Tabachneck) wrote:
> Can you just read them in at the same time? E.g.,
> data have;
> infile cards truncover;
> input tape_num junk $80./
> status $80.;
> if index(status,"1 RECORDS MARKED AS DELETED");
> 102247 UNABLE TO DELETE, MUST BE SCRATCH STATUS
> 1 RECORDS MARKED AS DELETED - TEST MODE ONLY
> 102401 UNABLE TO DELETE, MUST BE SCRATCH STATUS
> 0 RECORDS MARKED AS DELETED - TEST MODE ONLY
> On Thu, 14 May 2009 13:24:30 -0700, EVANTRA <EDMOND.VANBEB...@DTS.CA.GOV>
> >On May 14, 11:11 am, gerhard.hellrie...@T-ONLINE.DE (Gerhard
> >Hellriegel) wrote:
> >> you must provide much more about that:
> >> on what OS you are working? What are you trying to do exactly (program).
> >> Is that a tape dataset or on disk? What means "grab a tape"? What do you
> >> want to delete? What is the condition? Where is that text =" RECORDS
> >> MARKED AS DELETED"? Is that a content of any variable? A SAS variable?
> >> Perhaps you could provide a example like:
> >> I have a dataset with that contents
> >> row1 ......
> >> row2 ......
> >> row3 ......
> >> in row 2 is the text 'bla bla' and a VolSer 0815. In that case there
> >> should be a tape-mount and that tape 0815 should be deleted (scratched).
> >> I am on a zOS mainframe and I'm sure that my SAS session is allowed to
> >> mount tapes and scratch them.
> >> I tried that with the following program:
> >> .....
> >> .....
> >> The Log message was ... ( not only 2 lines without any context - I
> >> that WAS a log message? But where is ERROR: .... WARNING: .... , the
> >> mount message, the libname / filename for the tape mount, ...?
> >> Gerhard
> >> On Thu, 14 May 2009 10:51:44 -0700, EVANTRA
> >> wrote:
> >> >I'm trying to grab a tape(102247) if one row down =" RECORDS MARKED AS
> >> >DELETED". I'm somewhat of a SAS newbie but it looks like a Retain
> >> >might be the way to go but have never used it. Any ideas? Thanks in
> >> >advance.
> >> >102247 UNABLE TO DELETE, MUST BE SCRATCH STATUS
> >> > 1 RECORDS MARKED AS DELETED - TEST MODE ONLY- Hide
> quoted text -
> >> - Show quoted text -
> >Thanks for the help Gerald, I will try to give more details.
> >We are running a TMS report that generates a disk dataset with a list
> >of tapes and their status. I need to extract only the tapes out of
> >the report that are marked "1 RECORDS MARKED AS DELETED". The problem
> >I'm having is that this message is not on the same row as the
> >corresponding tape so how do I pull the tape number one row up when
> >the variable = "1 RECORDS MARKED AS DELETED"? How this helps and
> >makes sense. Thanks
> >Row1 102247 UNABLE TO DELETE, MUST BE SCRATCH STATUS
> >Row2 1 RECORDS MARKED AS DELETED - TEST MODE
> >Row3 102401 UNABLE TO DELETE, MUST BE SCRATCH STATUS
> >Row4 0 RECORDS MARKED AS DELETED - TEST MODE
> >ONLY- Hide quoted text -
> - Show quoted text -- Hide quoted text -
> - Show quoted text -
Thanks for the input Art and Joe...I think I understand the concepts.
I will try give these a shot and post my results.
Joe, in my case, I need to look back one line so using your example of
lag_val = lag(val); would my coding look something like lag_val = lag
(1)? Also, what is the 'set have;'