Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

to fetch data from PDS using Rexx

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: to fetch data from PDS using Rexx
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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: 1288
Location: Chennai, India

PostPosted: Tue Apr 15, 2008 7:21 pm    Post subject: Reply to: to fetch data from PDS using Rexx
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: 1288
Location: Chennai, India

PostPosted: Tue Apr 15, 2008 7:24 pm    Post subject: Reply to: to fetch data from PDS using Rexx
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    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Data replication from multiple Db2 ta... kishpra DB2 5 Mon Mar 27, 2017 9:58 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
No new posts REXX cdoe to purge a JOB from spool a... Sulabh Agrawal CLIST & REXX 11 Thu Mar 09, 2017 11:36 am
No new posts SPUFI -- Joining 3 tables – data in... Sysaron DB2 2 Wed Mar 08, 2017 4:18 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us