IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

SYMNAMES using COBDFSYM for OCCURS clause


IBM Mainframe Forums -> CLIST & REXX
Post new topic   This topic is locked: you cannot edit posts or make replies.
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

PostPosted: Tue Jul 10, 2018 5:38 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Tue Jul 10, 2018 6:58 pm
Reply with quote

Are you really sure that this should be in the REXX / CLIST section of the forum
Back to top
View user's profile Send private message
mistah kurtz

Active User


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

PostPosted: Tue Jul 10, 2018 7:06 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Tue Jul 10, 2018 9:00 pm
Reply with quote

ibmmainframes.com/about58496.html

but You could have found it Yourself googling with COBDFSYM
Back to top
View user's profile Send private message
mistah kurtz

Active User


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

PostPosted: Wed Jul 11, 2018 12:50 am
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Wed Jul 11, 2018 2:24 am
Reply with quote

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 icon_cool.gif
Back to top
View user's profile Send private message
mistah kurtz

Active User


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

PostPosted: Wed Jul 11, 2018 11:32 am
Reply with quote

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
View user's profile Send private message
jasorn
Warnings : 1

Active User


Joined: 12 Jul 2006
Posts: 191
Location: USA

PostPosted: Wed Aug 08, 2018 5:15 am
Reply with quote

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
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1314
Location: Vilnius, Lithuania

PostPosted: Wed Aug 08, 2018 3:06 pm
Reply with quote

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
View user's profile Send private message
jasorn
Warnings : 1

Active User


Joined: 12 Jul 2006
Posts: 191
Location: USA

PostPosted: Wed Aug 08, 2018 3:30 pm
Reply with quote

prino wrote:

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?

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
View user's profile Send private message
mbizzle

New User


Joined: 06 May 2020
Posts: 7
Location: United States

PostPosted: Wed May 06, 2020 6:54 pm
Reply with quote

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
View user's profile Send private message
m_a_n_u

New User


Joined: 04 Apr 2023
Posts: 3
Location: france

PostPosted: Wed May 31, 2023 9:13 pm
Reply with quote

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
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3076
Location: NYC,USA

PostPosted: Thu Jun 01, 2023 6:22 pm
Reply with quote

Thank you , that was a good add .
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies. View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts To search DB2 table based on Conditio... DB2 1
No new posts Updating a 1 byte thats in occurs mul... DFSORT/ICETOOL 6
No new posts NOT IN clause in COBOL pgm COBOL Programming 8
No new posts SUSBSCRIPT WITH SIGN IN PIC CLAUSE COBOL Programming 3
No new posts usage of CASE in WHERE clause DB2 10
Search our Forums:

Back to Top