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
 

 

Finding the copybook names in a cobol program.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
surya.kalyan

New User


Joined: 09 Jan 2007
Posts: 20
Location: Mumbai

PostPosted: Wed Jul 09, 2008 4:20 pm    Post subject: Finding the copybook names in a cobol program.
Reply with quote

I want to write a REXX tool which would extract the copybook names of a program and present a nice report.


Can anyone suggest me a method to extract copybook names if they are separated by more than one spaces?

e.g.

COPY MYCOPY1.

COPY MYCOPY2.
Back to top
View user's profile Send private message

surya.kalyan

New User


Joined: 09 Jan 2007
Posts: 20
Location: Mumbai

PostPosted: Wed Jul 09, 2008 4:21 pm    Post subject:
Reply with quote

Please assume that in the second statement
COPY MYCOPY2.

COPY and MYCOPY2 are separated by more than one spaces.
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Wed Jul 09, 2008 4:35 pm    Post subject:
Reply with quote

I believe an ISPF edit macro, combined with REXX's PARSE instruction will do the job.

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

REXX Moderator


Joined: 13 Mar 2006
Posts: 1228
Location: Israel

PostPosted: Wed Jul 09, 2008 4:36 pm    Post subject:
Reply with quote

With REXX, that's easy...
Code:
/* load cobol program in memory (FCBLPGM allocated to member)*/
"EXECIO * DISKR FCBLPGM (FINIS STEM PgmSrc."

/* loop on program contents scanning for COPY */
Do P = 1 To PgmSrc.0
   Parse Upper Var PgmSrc.P 1 . 7 Comment 8 CblLine 73 .
   If Comment = '*' Then Iterate
   If Word(CblLine,1) <> 'COPY' Then Iterate
   CopyName = Strip(Word(CblLine,2),'.')
   Say "Found COPY. Name is "CopyName
End
Back to top
View user's profile Send private message
Garry Carroll

Active Member


Joined: 08 May 2006
Posts: 995
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Wed Jul 09, 2008 4:58 pm    Post subject:
Reply with quote

Perhaps use ICEMAN/ICETOOL to:
..... extract the lines with substring " COPY "
..... process the results in workfile.
..... produce your "nice report" from the workfile ?

Regards,
Garry.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10256
Location: italy

PostPosted: Wed Jul 09, 2008 5:03 pm    Post subject: Reply to: Finding the copybook names in a cobol program.
Reply with quote

the brain work has already been done
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ispusr03/2.5.4?ACTION=MATCHES&REQUEST=isrlemx&TYPE=FUZZY&SHELF=ISPBKM08.bks&DT=19990728142027&CASE=&searchTopic=TOPIC&searchText=TEXT&searchIndex=INDEX&rank=RANK&ScrollTOP=FIRSTHIT#FIRSTHIT

You simple need to reformat the report ( if You are not satisfied with the native ispf report )
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
This topic is locked: you cannot edit posts or make replies. Cobol GUI (like Editor) Kala Mainframe COBOL Programming 14 Wed May 10, 2017 12:30 pm
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm
No new posts COBOL Code Parsers and Lineage Establ... balimanja COBOL Programming 2 Tue May 02, 2017 3:30 am
No new posts Cobol upgrade - source code missing f... gthmrj IBM Tools 1 Wed Apr 26, 2017 6:04 pm
No new posts Need help in REXX CALL program Raje1002 CLIST & REXX 5 Wed Apr 19, 2017 11:18 pm


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