|
|
| Author |
Message |
surya.kalyan
New User
Joined: 09 Jan 2007 Posts: 12 Location: Mumbai
|
|
|
|
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 |
|
 |
References
|
Posted: Wed Jul 09, 2008 4:20 pm Post subject: Re: Finding the copybook names in a cobol program. |
 |
|
|
 |
surya.kalyan
New User
Joined: 09 Jan 2007 Posts: 12 Location: Mumbai
|
|
|
|
Please assume that in the second statement
COPY MYCOPY2.
COPY and MYCOPY2 are separated by more than one spaces. |
|
| Back to top |
|
 |
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 1867 Location: Israel
|
|
|
|
I believe an ISPF edit macro, combined with REXX's PARSE instruction will do the job.
O. |
|
| Back to top |
|
 |
Marso
Active User
Joined: 13 Mar 2006 Posts: 288 Location: Israel
|
|
|
|
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 |
|
 |
Garry Carroll
Active User
Joined: 08 May 2006 Posts: 130 Location: Dublin, Ireland
|
|
|
|
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 |
|
 |
enrico-sorichetti
Global Moderator
Joined: 14 Mar 2007 Posts: 2565 Location: italy
|
|
| Back to top |
|
 |
|
|