View previous topic :: View next topic
|
Author |
Message |
ravimsmbaus
New User
Joined: 19 Mar 2007 Posts: 3 Location: bangalore
|
|
|
|
Hi All,
I need a small help. I want to code a Rexx that browses through a PDS and picks up specified lines/data from the PDS. Can any of you help me with that? |
|
Back to top |
|
|
Bill Dennis
Active Member
Joined: 17 Aug 2007 Posts: 562 Location: Iowa, USA
|
|
|
|
Will you specify the member names to search or should the REXX search all members of the PDS? |
|
Back to top |
|
|
ravimsmbaus
New User
Joined: 19 Mar 2007 Posts: 3 Location: bangalore
|
|
|
|
Yes, we have the PDS and Member name... for searching.
I already have figured out how to search for the string.
The problem that remains is .. i have to fetch 1) next 10 characters from the place the string matched in the member. |
|
Back to top |
|
|
Bill Dennis
Active Member
Joined: 17 Aug 2007 Posts: 562 Location: Iowa, USA
|
|
|
|
Will it be on the same line? Why not use the batch job generated from ISPF option 3.14 to do the search? |
|
Back to top |
|
|
ravimsmbaus
New User
Joined: 19 Mar 2007 Posts: 3 Location: bangalore
|
|
|
|
Yes, it will be the same line.
The reason we cannot go for 3.14 search is.. i have to check it every half an hour and there are not many abends in the application. So, it would save lots of my time. I have already coded a REXX that browses thru the joblogs( that are in pds form) and look for the keyword abend. if at all the keyword is found, I would put 2 more small tasks in IF condition. 1) search for the TRAN keyword. 2) and then if the keyword is found.. I would just need the next 10 characters .. so make out the transaction name..that I would restart again..
Now, can you please tell me how to go for
1) picking/fetching up the characters in a PDS..when you know the member name and everything.
2) how to fetch up the whole line.. is there any command to do that? |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
ravi,
Try this code for extracting the next 10 characters once the search string is found. I have kept it sinmple as u have mentioned that u have coded the other part.
XXXX - string to be searched
B - Stem variable
Code: |
do i = 1 to B.0
posx = pos("XXXX",B.i)
if posx > 0 then
DO
data = substr(B.i,posx+4,10)
queue data
END |
now DATA would have the 10 characters after the serch string. |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
Ravi,
Quote: |
how to fetch up the whole line.. is there any command to do that? |
To fetch the whole line just Queue in the entire line when the search is successful.
Code: |
do j = 1 to b.0
posx = pos("XXXXXXXX",B.J)
if posx > 0 then
do
b.j = strip(b.j)
queue b.j
end |
|
|
Back to top |
|
|
|