Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts HEX value search in a DB2 query maxsubrat DB2 2 Wed Oct 04, 2017 3:04 pm
This topic is locked: you cannot edit posts or make replies. Rexx to execute spool commands upendrasri CLIST & REXX 5 Wed Oct 04, 2017 6:54 am
No new posts Accessing CICS tran with map from JCL... navdeepaggarwal CICS 5 Tue Oct 03, 2017 6:15 pm
This topic is locked: you cannot edit posts or make replies. Rexx to execute spool commands upendrasri CLIST & REXX 47 Fri Sep 29, 2017 1:08 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us