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
 

 

Generating SYMNAMES using COBDFSYM

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Tue Jun 05, 2012 3:31 pm    Post subject: Generating SYMNAMES using COBDFSYM
Reply with quote

Hi,

I am trying to generate the SYMNAMES using COBDFSYM. However I am not able to generate the SYMNAMES for the occurs clause.

Example : Copybook

Code:

01  XXX-RECORD.                                               
  03  XXX-BEGIN.                                               
    05  FILE-SIZE             PICTURE S9(4) COMP.             
    05  FILE-NAME             PICTURE X(2).                   
  03  XXX-KEY.                                                 
    05  KEY-G2-VARI           PICTURE X(50).                   
    05  FILLER                REDEFINES KEY-G2-VARI.           
        10  KEY-G2Y.                                           
            15  KEY-XXX-ACCT  PICTURE S9(15) COMP-3.           
            15  KEY-XXX-DATE  PICTURE S9(8)  COMP.             
            15  FILLER        PICTURE X(38).                   
  03  XXX-DATA.                                               
    05  XXX-LST-CHG-DATE      PICTURE S9(8)     COMPUTATIONAL.
    05  XXX-LEVEL-EACH        OCCURS 02 TIMES                 
                              INDEXED BY XXX-LEVL-INDEX.       
        10  XXX-LEVEL-IND     PICTURE 9.                       
        10  XXX-REPT-EACH     OCCURS 03 TIMES                 
                              INDEXED BY XXX-REPT-INDEX.       
            15  XXX-REPT-PERCENT                               
                              PICTURE S9(03)V9(06) COMP-3.   


Output SYMNAMES Generated:
Code:

XXX-RECORD,1,90,CH                           
XXX-BEGIN,1,4,CH                             
FILE-SIZE,1,2,FI                             
FILE-NAME,3,2,CH                             
XXX-KEY,5,50,CH                               
KEY-G2-VARI,5,50,CH                           
KEY-G2Y,5,50,CH                               
KEY-XXX-ACCT,5,8,PD                           
KEY-XXX-DATE,13,4,FI                         
XXX-DATA,55,36,CH                             
XXX-LST-CHG-DATE,55,4,FI                     
XXX-LEVEL-EACH,59,16,CH                       
_1,1,Index-Nam,CH                             
XXX-LEVEL-IND,59,1,ZD                         
XXX-REPT-EACH,60,5,CH                         
_2,1,Index-Nam,CH                             
XXX-REPT-PERCENT,60,5,PD       


We can see that for the occurs clause the SYMNAMES have _1,1,Index-Nam,CH .

Can any one let me know how to generate the SYMNAMES correctly when the copybook have occurs clause?

Thanks in Advance.
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7251

PostPosted: Tue Jun 05, 2012 4:12 pm    Post subject: Reply to: Generating SYMNAMES using COBDFSYM
Reply with quote

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

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Tue Jun 05, 2012 5:17 pm    Post subject:
Reply with quote

Thanks Bill
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1722
Location: UK

PostPosted: Tue Jun 05, 2012 11:51 pm    Post subject:
Reply with quote

Are you doing this in Rexx?
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Wed Jun 06, 2012 12:14 pm    Post subject:
Reply with quote

Hi Nic,

COBDFSYM is a Rexx routine provided by IBM to generate SYMNAMES from cobol copybook. But this routine is not handling Occurs clauses properly...
Back to top
View user's profile Send private message
don.leahy

Active Member


Joined: 06 Jul 2010
Posts: 642
Location: Whitby, ON, Canada

PostPosted: Wed Jun 06, 2012 6:02 pm    Post subject:
Reply with quote

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. icon_cool.gif
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 -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SYMNAMES problem jacobdng DFSORT/ICETOOL 7 Thu Dec 22, 2016 7:47 am
No new posts How to get previous month in SYMNAMES Suganya87 SYNCSORT 9 Fri Oct 28, 2016 1:37 pm
No new posts Yesterday's Date using SYMNAMES and F... SathishCS DFSORT/ICETOOL 2 Mon Jun 29, 2015 6:59 pm
No new posts SYMNAMES in SORT card tvinodkumar7 DFSORT/ICETOOL 2 Fri Feb 13, 2015 10:35 am
No new posts Generating an o/p file with dummy i/p... wiprov DFSORT/ICETOOL 2 Wed Sep 10, 2014 6:16 pm


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