Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
Nice to see someone using SYMNAMES :-)
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.
For the data definition try:
Code:
FIELD-1,30,7,PD
FIELD-2 *,=,=
FIELD-3 *,=,=
The * will use the next available start position (37 for FIELD-2) and the = will "copy" the information at that position from the previous field, so all the lengths and types will be the same, without explicit coding.
Everything can be checked in the SYMNOUT where it will have been expanded to the actual position, lenght and type.
Joined: 06 Jul 2010 Posts: 765 Location: Whitby, ON, Canada
I have noticed small glitches in COBDFSYM too. IBM provides it 'as is', and you are free to change it if you wish.
For instance, I fixed an issue affecting variable sized groups. (Unfortunately I don't remember what the problem was). I also added a couple of input parameters, one to indicate the starting offset (handy for VB files) and other to control whether to use hyphen (-) or underscore (_) in the symbol names.
I also added a feature to generate a MAPDEF structure (it is something that can be used by REXX IMS to parse IMS segments).
Anyway, my point is that if COBDFSYM doesn't work the way you want it to, then change it. It's Rexx, not rocket science.
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