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
 

 

REXX program to search for copybooks

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
anamika roy

New User


Joined: 06 Sep 2007
Posts: 2
Location: India

PostPosted: Mon Sep 10, 2007 5:33 pm    Post subject: REXX program to search for copybooks
Reply with quote

Hi,

I have a requirement where using a REXX tool I need to find out the names of the copybook used in various COBOL programs. The COBOL programs are kept in a PDS. The format of the output should be like:

COPYBOOK name; Name of the COBOL program where the copybook is found.

Thanks,
Anamika
Back to top
View user's profile Send private message

ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Mon Sep 10, 2007 6:28 pm    Post subject:
Reply with quote

I would use an Edit-Macro: Exclude all comments line, then look for the word COPY. Make sure that it the COBOL statement and not part of a literal.

O.
Back to top
View user's profile Send private message
anamika roy

New User


Joined: 06 Sep 2007
Posts: 2
Location: India

PostPosted: Tue Sep 11, 2007 11:43 am    Post subject:
Reply with quote

This is the way we do. But in our case there are approximately 30 COBOL programs and for this we need to write a REXX program that will extract all the copybooks from the 30 COBOL programs. As this will save a lot of time.

Thanks,
Anamika
Back to top
View user's profile Send private message
Aaru

Senior Member


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

PostPosted: Tue Sep 11, 2007 12:33 pm    Post subject: Reply to: REXX program to search for copybooks
Reply with quote

Quote:

But in our case there are approximately 30 COBOL programs and for this we
need to write a REXX program
that will extract all the copybooks from the 30 COBOL programs. As this will save a lot of time


1) First get the member list from the PDS into a stem variable 1 using the LISTDS and the OUTTRAP command.
2) Use the member name available in the the steam variable 1 to read the contents of the member into another stem variable (2).
The second stem variable will have the contents of the members. Then search for the word COPY and queue the line to get the copybook name. Also queue the member name to be displayed in the report. Put this in
a loop till the last member.
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Tue Sep 11, 2007 12:36 pm    Post subject:
Reply with quote

What I meant is that you should run this edit macro against each member. Doing this was widely dicussed in this forum.

O.
Back to top
View user's profile Send private message
acevedo

Active User


Joined: 11 May 2005
Posts: 344
Location: Spain

PostPosted: Tue Sep 11, 2007 12:54 pm    Post subject:
Reply with quote

I would do it in 2 steps:

  1. Use ISRSUPC to search for COPY (tip: use IDPFX,COBOL,DPCBCMT parameters)
  2. Code a Rexx program (or a Cobol program) to read the output of the previous step and write the copybook name and the program where it was found.

mmmmmm... ten minutes? ;)
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts I want to retire TRX and use only Rex... Abhinav Sharma CLIST & REXX 4 Sat Jul 29, 2017 2:53 am
No new posts Iterative use of a REXX script causin... bryonyh CLIST & REXX 4 Fri Jul 28, 2017 12:52 pm
No new posts Passing data from REXX to C programme... chong.zhou CLIST & REXX 3 Wed Jul 26, 2017 9:11 pm
No new posts REXX to get the all datasets name parasmalik20 CLIST & REXX 5 Tue Jul 18, 2017 9:10 pm
No new posts How system know which REXX to excute? jackzhang75 CLIST & REXX 14 Thu Jul 06, 2017 1:09 am


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