IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

to fetch data from PDS using Rexx


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ravimsmbaus

New User


Joined: 19 Mar 2007
Posts: 3
Location: bangalore

PostPosted: Tue Apr 15, 2008 6:04 pm
Reply with quote

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
View user's profile Send private message
Bill Dennis

Active Member


Joined: 17 Aug 2007
Posts: 562
Location: Iowa, USA

PostPosted: Tue Apr 15, 2008 6:21 pm
Reply with quote

Will you specify the member names to search or should the REXX search all members of the PDS?
Back to top
View user's profile Send private message
ravimsmbaus

New User


Joined: 19 Mar 2007
Posts: 3
Location: bangalore

PostPosted: Tue Apr 15, 2008 6:27 pm
Reply with quote

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
View user's profile Send private message
Bill Dennis

Active Member


Joined: 17 Aug 2007
Posts: 562
Location: Iowa, USA

PostPosted: Tue Apr 15, 2008 6:51 pm
Reply with quote

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
View user's profile Send private message
ravimsmbaus

New User


Joined: 19 Mar 2007
Posts: 3
Location: bangalore

PostPosted: Tue Apr 15, 2008 7:07 pm
Reply with quote

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
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Tue Apr 15, 2008 7:21 pm
Reply with quote

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
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Tue Apr 15, 2008 7:24 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Store the data for fixed length COBOL Programming 1
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
Search our Forums:

Back to Top