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 exec find copy book size in cobol program

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

New User


Joined: 09 Jun 2013
Posts: 2
Location: INDIA

PostPosted: Wed Jun 12, 2013 8:25 pm    Post subject: rexx exec find copy book size in cobol program
Reply with quote

Can someone help me find a rexx exec to find the copybook length?
Back to top
View user's profile Send private message

Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1738
Location: Bloomington, IL

PostPosted: Wed Jun 12, 2013 8:51 pm    Post subject: Reply to: rexx macro to find copy book size in cobol program
Reply with quote

Doing so would require implementing a significant part of the compiler in Rexx. I recommend that instead you create a skeleton program that includes the copybook, compile it in the foreground, and then use Rexx (or another tool) to pare down the listing to what you want.
Back to top
View user's profile Send private message
mistah kurtz

Active User


Joined: 28 Jan 2012
Posts: 268
Location: Room: TREE(3). Hilbert's Hotel

PostPosted: Wed Jun 12, 2013 9:43 pm    Post subject:
Reply with quote

The cobol copybook parser COBDFSYM would probably be useful for this.
This is a Rexx routine provided by IBM to generate SYMNAMES from cobol copybook.

You can refer to the SORTTRCK document to understand how to use it.
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Wed Jun 12, 2013 10:11 pm    Post subject:
Reply with quote

Why not make use of tools like file manager or file aid or etc?
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7226

PostPosted: Wed Jun 12, 2013 10:40 pm    Post subject: Reply to: rexx exec find copy book size in cobol program
Reply with quote

Why do you want to know the copybook length?
Back to top
View user's profile Send private message
BIBHU PRASANNA SINGH

New User


Joined: 09 Jun 2013
Posts: 2
Location: INDIA

PostPosted: Thu Jun 13, 2013 9:54 pm    Post subject: rexx exec find copy book size in cobol program
Reply with quote

Actually what i meant was instead of using changeman's listing option or file manager or manually calculating the copybook, can't a rexx macro be designed so that we can know a particular copybook length ?
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7226

PostPosted: Thu Jun 13, 2013 10:07 pm    Post subject: Reply to: rexx exec find copy book size in cobol program
Reply with quote

If you want to put an absurd amount of effort into it, feel free (if your employer is happy with that).

You could put less effort into it, and have it not work all the time.

Or just pick it up from the compiler output, where the compiler has already done all the work, which is guaranteed to match what the compiler does (because it is the compiler) without you even having to write a line of code.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Jun 13, 2013 10:09 pm    Post subject:
Reply with quote

Hello and welcome to the forum,

Yes, this can be done in REXX, but there is NO reason to do so.

If you search within the forum, you should find multiple ways to get a "copybook" length.

You did Not answer Bill's question:
Why do you want to know the copybook length?
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Fri Jun 14, 2013 12:46 am    Post subject: Reply to: rexx exec find copy book size in cobol program
Reply with quote

Create a dummy COBOL program, add a COPY statement of the target copybook into WS, compile the program (using NOCOMPILE option) and you're done.

No muss, no fuss....
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1714
Location: UK

PostPosted: Fri Jun 14, 2013 1:00 am    Post subject: Reply to: rexx exec find copy book size in cobol program
Reply with quote

I have a rexx program that can do this BUT ... it is highly tailored to do copybooks that fit a certain criteria so no OCCURS or REDEFINES are needed and the PIC has to start in a certain column. It gives incorrect results if the copybook has not been maintained according to the rules. Only took a day to write and test. Probably another day or two and I could extend it but I do not need to.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Jun 14, 2013 1:01 am    Post subject:
Reply with quote

Hi Bill,

Yup, this was suggested in the first reply to the topic.

Not sure why TS does not want to try this.

Also, if TS organization has CA-Easytrieve, there is a feature that will convert a COBOL definition to an Easytrieve definition, which shows the displacement/length of all of the fields.

?

d
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Fri Jun 14, 2013 6:12 am    Post subject: Reply to: rexx exec find copy book size in cobol program
Reply with quote

Dick,

Sorry, blew right past that....
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 syncsort: copy lines after the keyword shreya19 SYNCSORT 6 Fri Dec 02, 2016 9:47 am
No new posts How to find the first monday of the w... abdulrafi COBOL Programming 10 Fri Nov 25, 2016 3:24 pm
No new posts IMS BMP program causes 878 system abend Artemk IMS DB/DC 7 Tue Nov 22, 2016 8:26 pm
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
This topic is locked: you cannot edit posts or make replies. RANDOM Function in COBOL swapnil781 COBOL Programming 2 Tue Nov 15, 2016 6:17 pm


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