View previous topic :: View next topic
|
Author |
Message |
mistah kurtz
Active User
Joined: 28 Jan 2012 Posts: 316 Location: Room: TREE(3). Hilbert's Hotel
|
|
|
|
Hi,
I am trying to generate the SYMNAMES using COBDFSYM, which uses Data Division Map in the compile listing to generate the symbols. However I am not able to generate the SYMNAMES for the occurs clause. In the Data Division Map, I can identify if a field is having OCCURS clause, but not able to find the number of occurrences.
Can any one let me know how to generate the SYMNAMES correctly when the copybook have occurs clause? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Are you really sure that this should be in the REXX / CLIST section of the forum |
|
Back to top |
|
|
mistah kurtz
Active User
Joined: 28 Jan 2012 Posts: 316 Location: Room: TREE(3). Hilbert's Hotel
|
|
|
|
COBDFSYM is a rexx program(Freeware courtesy of IBM), that's why I posted in REXX forum.
Copybook:
Code: |
01 INPUT-AREA.
05 DATA-INPUT-AREA.
07 WS-INPUT-AREA-01
PIC X(1).
88 WS-VALUE-1 VALUE '1'.
88 WS-VALUE-2 VALUE '0'.
07 WS-INPUT-AREA-02
PIC X(4).
07 WS-INPUT-AREA-03
PIC S9(3) COMP-3.
07 WS-INPUT-AREA-04
PIC 9(2).
07 WS-INPUT-AREA-05
PIC S9(5) COMP-3
OCCURS 3 TIMES
INDEXED BY WS-INPUT-AREA-05-X.
07 WS-INPUT-AREA-06
PIC S9(3) COMP-3. |
Data Division Map:
Code: |
0Data Division Map
0Data Definition Attribute codes (rightmost column) have the following meanings:
D = Object of OCCURS DEPENDING G = GLOBAL S = Spanned file
E = EXTERNAL O = Has OCCURS clause U = Undefined format file
F = Fixed-length file OG= Group has own length definition V = Variable-length file
FB= Fixed-length blocked file R = REDEFINES VB= Variable-length blocked file
0Source Hierarchy and Base Hex-Displacement Asmblr Data Data Def
LineID Data Name Locator Blk Structure Definition Data Type Attributes
2 PROGRAM-ID HELLO-------------------------------------------------------------------------------------------------------*
8 1 INPUT-AREA. . . . . . . . . . . . . . . . . . BLW=00000 000 DS 0CL20 Group
9 2 DATA-INPUT-AREA . . . . . . . . . . . . . . BLW=00000 000 0 000 000 DS 0CL20 Group
10 3 WS-INPUT-AREA-01. . . . . . . . . . . . . BLW=00000 000 0 000 000 DS 1C Display
12 88 WS-VALUE-1. . . . . . . . . . . . . . . .
13 88 WS-VALUE-2. . . . . . . . . . . . . . . .
14 3 WS-INPUT-AREA-02. . . . . . . . . . . . . BLW=00000 001 0 000 001 DS 4C Display
16 3 WS-INPUT-AREA-03. . . . . . . . . . . . . BLW=00000 005 0 000 005 DS 2P Packed-Dec
18 3 WS-INPUT-AREA-04. . . . . . . . . . . . . BLW=00000 007 0 000 007 DS 2C Disp-Num
20 3 WS-INPUT-AREA-05. . . . . . . . . . . . . BLW=00000 009 0 000 009 DS 3P Packed-Dec O
23 WS-INPUT-AREA-05-X. . . . . . . . . . . . IDX=00001 000 Index-Name
25 3 WS-INPUT-AREA-06. . . . . . . . . . . . . BLW=00000 012 0 000 012 DS 2P Packed-Dec |
|
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
Back to top |
|
|
mistah kurtz
Active User
Joined: 28 Jan 2012 Posts: 316 Location: Room: TREE(3). Hilbert's Hotel
|
|
|
|
enrico-sorichetti wrote: |
http://ibmmainframes.com/about58496.html
but You could have found it Yourself googling with COBDFSYM |
Yes indeed. I did find, but It didn't answer the query that I raised. Hence re-posted. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
I just reread the topic ..
Quote: |
The OCCURS cannot be directly reflected, no subscripting in the Sort products. You have a little extra manual or programmatic effort to give each occurence a unique name.
|
was the answer to Your question |
|
Back to top |
|
|
mistah kurtz
Active User
Joined: 28 Jan 2012 Posts: 316 Location: Room: TREE(3). Hilbert's Hotel
|
|
|
|
Sorry for not being clear. My question was how to determine the number of occurrences using the compile listing which this COBDFSYM macro uses? |
|
Back to top |
|
|
jasorn Warnings : 1 Active User
Joined: 12 Jul 2006 Posts: 191 Location: USA
|
|
|
|
I've had quite a bit of experience with this and an easytrieve macro creator from cobol maps. Both have their issues. In the end I wrote my own that I can't share. One solution I found might be acceptable to those with no better means and who have access to fileaide, might be to convert the copybook to file aid format and then read that to create the version you need.
Then again, if you don't have a bunch to do, might just as well expand the occurrences manually.
I have yet to find something that converts copybooks with lots of occurs to either a symnames file or easytrieve macro as well as the program i wrote, but would love to hear of something so I can decommission my pile of mess. |
|
Back to top |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1314 Location: Vilnius, Lithuania
|
|
|
|
jasorn wrote: |
I have yet to find something that converts copybooks with lots of occurs to either a symnames file or easytrieve macro as well as the program i wrote, but would love to hear of something so I can decommission my pile of mess. |
ESYMSORT, with RAP00110 as backend does this for PL/I... (Both can be found @ Prino's z/OS Tools and utilities)
And why can't you share your code? |
|
Back to top |
|
|
jasorn Warnings : 1 Active User
Joined: 12 Jul 2006 Posts: 191 Location: USA
|
|
|
|
Thanks. I'll take a look.
Can't share my code because it's not mine, really. I just created it but I don't own it. Guess I should start phrasing that differently. |
|
Back to top |
|
|
mbizzle
New User
Joined: 06 May 2020 Posts: 7 Location: United States
|
|
|
|
I registered just so I could share this fix to COBDFSYM.
I had been using it for a few years now, and loved it and was sad when our upgrade from cobol compiler V4 to V6 bricked this program. Luckily, it was a fairly simple fix to update it.
Here are the fixes you need to make to allow it to be compatible with the V6 (and i assume V5) compilers.
I am posting this on a few forums so that others may find it that have the same issue.
change this line
parse var line 92 asmdef datatyp .
to
parse var line 87 asmdef datatyp .
and add this line
do until left(line,1) = '1'
call Put_line
parse pull line
if pos('End of Data Division Map',line)<> 0 then leave
end |
|
Back to top |
|
|
m_a_n_u
New User
Joined: 04 Apr 2023 Posts: 3 Location: france
|
|
|
|
To make it run under COBOL for z/OS 6.1.0, i had to change :
hexoff = substr(line,79,3) !! substr(line,83,3) by
hexoff = substr(line,75,6)
and
if pos('End of Data Division Map',line)<> 0 then leave by
if pos('Messages Total',line) > 0 then leave
and i also changed all the Substr() with LineID by Pos() |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3076 Location: NYC,USA
|
|
|
|
Thank you , that was a good add . |
|
Back to top |
|
|
|