Date: Tue, 5 Mar 2002 14:23:47 -0500
Reply-To: "Carriere, Ron" <rcarriere@MEDNET.UCLA.EDU>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Carriere, Ron" <rcarriere@MEDNET.UCLA.EDU>
Subject: How to read previous lines based upon string in current line.
I have dataset that consists of 40K+ lines of MVS JCL. I am attempting to
output a list of datasets cataloged by that JCL. Pseudo code for the task
would be
Read a line;
IF a line contains the string "CATLG" then do;
if line contains "dsn=' then
output the line;
else do;
read and then output the two previous and then the
current line;
end;
end;
The "else do" part is required because the dataset name is sometimes on
one of the two previous lines. That is part I can't accomplish without
sorting and resorting the dataset, but there must be a better way using
line pointer controls, no?
Ron Carriere
UCLA Medical Center
|