COBOL COPY BOOK

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

edward_m
Charter Member
Charter Member
Posts: 257
Joined: Fri Jun 24, 2005 9:34 am
Location: Philadelphia,PA

COBOL COPY BOOK

Post by edward_m »

I am new to work with Cobol COpy Books..
I got Cobol Copy Books and when i try to import the table definitions from that file,its not allowing me because import button is dimmed.
I tried to import using Manager--> import ---->Table definitions ----> Cobol File Definitions then i passed the Cobol file definition path name then import button should be enabled but its dimmed eventhough i pointed to the currect directory..
below is the cobol copy book definitions

Code: Select all

******************************************************************
      * BDIPDATA.TXT COPYBOOK
      ******************************************************************00040000

       01  BDIPDATA-RECORD                    PIC X(97).
           05  BDIPDATA-RECORD-ID             PIC X(03).
           05  BDIPDATA-RECORD-DATA           PIC X(93).
           05  BDIPDATA-RECORD-DELIMITER-X    PIC X(01).

      **** RECORD-ID = 100
           05  BDIP100-RECORD REDEFINES BDIPDATA-RECORD-DATA.
               10 BDIP100-KEY                 PIC X(17).
               10 BDIP100-INVOICE-NUMBER      PIC X(21).
               10 FILLER REDEFINES BDIP100-INVOICE-NUMBER.
                  15 BDIP100-COMPANY-CODE     PIC X(02).
                  15 BDIP100-ACCOUNT-NUMBER   PIC X(15).
                  15 FILLER                   PIC X(04).
               10 BDIP100-FORM-NUMBER         PIC X(04).
               10 BDIP100-TRANSACTION-DATE    PIC X(08).
               10 BDIP100-COVG-SHORT-DESCRIPT PIC X(06).
               10 FILLER                      PIC X(37).

      **** RECORD-ID = 200
           05  BDIP200-RECORD REDEFINES BDIPDATA-RECORD-DATA.
               10 BDIP200-COVG-BEGIN-DATE     PIC X(08).
               10 FILLER                      PIC X(02).
               10 BDIP200-COVG-END-DATE       PIC X(08).
               10 FILLER                      PIC X(02).
               10 BDIP200-DUE-DATE            PIC X(08).
               10 FILLER                      PIC X(03).
               10 BDIP200-TOTAL-DUE           PIC X(11).
               10 FILLER                      PIC X(03).
               10 BDIP200-MEMBER-NUMBER       PIC X(15).
               10 FILLER                      PIC X(05).
               10 BDIP200-GROUP-NUMBER        PIC X(06).
               10 FILLER                      PIC X(06).
               10 BDIP200-ACCOUNT-NUMBER      PIC X(15).
               10 FILLER                      PIC X(01).

      **** RECORD-ID = 201
           05  BDIP201-RECORD REDEFINES BDIPDATA-RECORD-DATA.
               10 FILLER                      PIC X(03).
               10 BDIP201-BILL-TYPE           PIC X(21).
               10 FILLER                      PIC X(69).

      **** RECORD-ID = 202
           05  BDIP202-RECORD REDEFINES BDIPDATA-RECORD-DATA.
               10 FILLER                      PIC X(01).
               10 BDIP202-CUSTOMER-NAME       PIC X(29).
               10 FILLER                      PIC X(63).

      **** RECORD-ID = 203
           05  BDIP203-RECORD REDEFINES BDIPDATA-RECORD-DATA.
               10 FILLER                      PIC X(01).
               10 BDIP203-CUSTOMER-ADDR1      PIC X(39).
               10 FILLER                      PIC X(53).

      **** RECORD-ID = 204
           05  BDIP204-RECORD REDEFINES BDIPDATA-RECORD-DATA.
               10 FILLER                      PIC X(01).
               10 BDIP204-CUSTOMER-ADDR2      PIC X(39).
               10 FILLER                      PIC X(53).

      **** RECORD-ID = 205
           05  BDIP205-RECORD REDEFINES BDIPDATA-RECORD-DATA.
               10 FILLER                      PIC X(01).
               10 BDIP205-CUSTOMER-ADDR3      PIC X(39).
               10 FILLER                      PIC X(53).

      **** RECORD-ID = 220
           05  BDIP220-RECORD REDEFINES BDIPDATA-RECORD-DATA.
               10 FILLER                      PIC X(03).
               10 BDIP220-COVG-STARTS         PIC X(08).
               10 FILLER                      PIC X(05).
               10 BDIP220-COVG-ENDS           PIC X(08).
               10 FILLER                      PIC X(05).
               10 BDIP220-COVG-DESCRIPTION    PIC X(50).
               10 FILLER                      PIC X(02).
               10 BDIP220-COVG-AMOUNT         PIC X(11).
               10 FILLER                      PIC X(01).

      **** RECORD-ID = 230
           05  BDIP230-RECORD REDEFINES BDIPDATA-RECORD-DATA.
               10 FILLER                      PIC X(49).
               10 BDIP230-CHARGE-TEXT         PIC X(30).
               10 FILLER                      PIC X(02).
               10 BDIP230-CHARGE-AMOUNT       PIC X(11).
               10 FILLER                      PIC X(01).

      **** RECORD-ID = 240
           05  BDIP240-RECORD REDEFINES BDIPDATA-RECORD-DATA.
               10 FILLER                      PIC X(07).
               10 BDIP240-MESSAGE-TEXT        PIC X(78).
               10 FILLER                      PIC X(08).

      **** RECORD-ID = 250
           05  BDIP250-RECORD REDEFINES BDIPDATA-RECORD-DATA.
               10 FILLER                      PIC X(56).
               10 BDIP250-PAYMENT-ASOF-DATE   PIC X(08).
               10 FILLER                      PIC X(29).
Could anybody suggest me why its not imported??
Thanks in Advance..
Last edited by edward_m on Wed Dec 20, 2006 10:17 am, edited 1 time in total.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

I'm not sure why the button is dimmed, but your lines all need to start on column 8 or 12 except for the comment, which need to start on column 7
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

When you import from a COBOL FD you can specify the column in which the level 01 item begins. The import wizard expects the A margin and B margin to be properly configured (two+ levels of indenting, usually four spaces each, though the importer can be flexible about that).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
edward_m
Charter Member
Charter Member
Posts: 257
Joined: Fri Jun 24, 2005 9:34 am
Location: Philadelphia,PA

Post by edward_m »

By default start position is 8 when i import the cobol FD and also i did check in copy book, 01 level starts at 8 position and subsequent level starts after 4 positions of the top level i.e 01 level starts at 8,05 level starts at 12, level 10 starts at 16 so on.Still import button is dimmed.
Please advise me ..is there any thing wrong with the definitions in Cobol Copy Book.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Try editing the FD so that it contains no comments or blank lines. I know this shouldn't be needed, but it sometimes works.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
edward_m
Charter Member
Charter Member
Posts: 257
Joined: Fri Jun 24, 2005 9:34 am
Location: Philadelphia,PA

Post by edward_m »

ray.wurlod wrote:Try editing the FD so that it contains no comments or blank lines. I know this shouldn't be needed, but it sometimes works.
I deleted all comments and blank lines.Still nothing is showing up in tables.
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Were you able to see the tables when you open the copy book from import wizard?
You can mention the start position from where you need to import, do you get any error when you open the file.
If tables have appeared, have you selected any of the tables before clikcing the Import button?
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Can you please edit your original post on this thread; enclose it in Code tags to preserve the indenting, disable smilies then click Submit? Then we can copy/paste the FD and make some tests.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
edward_m
Charter Member
Charter Member
Posts: 257
Joined: Fri Jun 24, 2005 9:34 am
Location: Philadelphia,PA

Post by edward_m »

ray.wurlod wrote:Can you please edit your original post on this thread; enclose it in Code tags to preserve the indenting, disable smilies then click Submit? Then we can copy/paste the FD and make some tests.
Ray,
Edited my original post.
Thanks..
edward_m
Charter Member
Charter Member
Posts: 257
Joined: Fri Jun 24, 2005 9:34 am
Location: Philadelphia,PA

Post by edward_m »

Were you able to see the tables when you open the copy book from import wizard?
No..i am not seeing any tables.
You can mention the start position from where you need to import, do you get any error when you open the file.
I mentioned the start position as 8..No errors when i open the file.
If tables have appeared, have you selected any of the tables before clikcing the Import button?
No tables shown in tables box.
thurmy34
Premium Member
Premium Member
Posts: 198
Joined: Fri Mar 31, 2006 8:27 am
Location: Paris

Post by thurmy34 »

Hi

The "bug" is on your level 01.
It's the name of the record and cannot be dimensionned.

Code: Select all

You had 
  01  BDIPDATA-RECORD                    PIC X(97). 
           05  BDIPDATA-RECORD-ID             PIC X(03). 
           05  BDIPDATA-RECORD-DATA           PIC X(93). 
           05  BDIPDATA-RECORD-DELIMITER-X    PIC X(01). 

You can say
 01 My Record
           03 BDIPDATA-RECORD                    PIC X(97). 
                 05  BDIPDATA-RECORD-ID             PIC X(03). 
                 05  BDIPDATA-RECORD-DATA           PIC X(93). 
                 05  BDIPDATA-RECORD-DELIMITER-X    PIC X(01). 
Now the import button is enabled.
Hope This Helps
Regards
edward_m
Charter Member
Charter Member
Posts: 257
Joined: Fri Jun 24, 2005 9:34 am
Location: Philadelphia,PA

Post by edward_m »

thurmy34 wrote:Hi

The "bug" is on your level 01.
It's the name of the record and cannot be dimensionned.

Code: Select all

You had 
  01  BDIPDATA-RECORD                    PIC X(97). 
           05  BDIPDATA-RECORD-ID             PIC X(03). 
           05  BDIPDATA-RECORD-DATA           PIC X(93). 
           05  BDIPDATA-RECORD-DELIMITER-X    PIC X(01). 

You can say
 01 My Record
           03 BDIPDATA-RECORD                    PIC X(97). 
                 05  BDIPDATA-RECORD-ID             PIC X(03). 
                 05  BDIPDATA-RECORD-DATA           PIC X(93). 
                 05  BDIPDATA-RECORD-DELIMITER-X    PIC X(01). 
Now the import button is enabled.
Thanks for your response thurmy34..
Now i am getting the error for line
05 BDIP100-RECORD REDEFINES BDIPDATA-RECORD-DATA. says
'BDIPDATA-RECORD-DATA' column must redefine a previous column which has the same level number.
Please Advise ..
thurmy34
Premium Member
Premium Member
Posts: 198
Joined: Fri Mar 31, 2006 8:27 am
Location: Paris

Post by thurmy34 »

Hi
The message is not ver clear.
The import works with this copy book.

Code: Select all

****************************************************************** 
      * BDIPDATA.TXT COPYBOOK 
******************************************************************

       01  BDIPDATA-RECORD                    . 
           05  BDIPDATA-RECORD-ID             PIC X(03). 
           05  BDIPDATA-RECORD-DATA           PIC X(93). 
      **** RECORD-ID = 100 
           05  BDIP100-RECORD REDEFINES BDIPDATA-RECORD-DATA. 
               10 BDIP100-KEY                 PIC X(17). 
               10 BDIP100-INVOICE-NUMBER      PIC X(21). 
               10 FILLER REDEFINES BDIP100-INVOICE-NUMBER. 
                  15 BDIP100-COMPANY-CODE     PIC X(02). 
                  15 BDIP100-ACCOUNT-NUMBER   PIC X(15). 
                  15 FILLER                   PIC X(04). 
               10 BDIP100-FORM-NUMBER         PIC X(04). 
               10 BDIP100-TRANSACTION-DATE    PIC X(08). 
               10 BDIP100-COVG-SHORT-DESCRIPT PIC X(06). 
               10 FILLER                      PIC X(37). 

      **** RECORD-ID = 200 
           05  BDIP200-RECORD REDEFINES BDIPDATA-RECORD-DATA. 
               10 BDIP200-COVG-BEGIN-DATE     PIC X(08). 
               10 FILLER                      PIC X(02). 
               10 BDIP200-COVG-END-DATE       PIC X(08). 
               10 FILLER                      PIC X(02). 
               10 BDIP200-DUE-DATE            PIC X(08). 
               10 FILLER                      PIC X(03). 
               10 BDIP200-TOTAL-DUE           PIC X(11). 
               10 FILLER                      PIC X(03). 
               10 BDIP200-MEMBER-NUMBER       PIC X(15). 
               10 FILLER                      PIC X(05). 
               10 BDIP200-GROUP-NUMBER        PIC X(06). 
               10 FILLER                      PIC X(06). 
               10 BDIP200-ACCOUNT-NUMBER      PIC X(15). 
               10 FILLER                      PIC X(01). 
           05  BDIPDATA-RECORD-DELIMITER-X    PIC X(01). 
The redefines are just after the related zone.
I moved the 05 BDIPDATA-RECORD-DELIMITER-X PIC X(01) line at then end of the file.
Hope This Helps
Regards
edward_m
Charter Member
Charter Member
Posts: 257
Joined: Fri Jun 24, 2005 9:34 am
Location: Philadelphia,PA

Post by edward_m »

Thanks a lot for your help thurmy34.
Able to import the file definitions.
Could you please explain how do we define these in CFF Stage??
Please suggest me the way to parse this cobol file based on record type

Thanks in Advance..
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Why cant you import the Imported table definition into CFF stage?
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
Post Reply