Page 1 of 2

COBOL COPY BOOK

Posted: Fri Oct 13, 2006 2:48 pm
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..

Posted: Fri Oct 13, 2006 3:11 pm
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

Posted: Fri Oct 13, 2006 3:32 pm
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).

Posted: Tue Dec 19, 2006 10:48 am
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.

Posted: Tue Dec 19, 2006 2:12 pm
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.

Posted: Tue Dec 19, 2006 3:22 pm
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.

Posted: Tue Dec 19, 2006 4:30 pm
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?

Posted: Tue Dec 19, 2006 5:17 pm
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.

Posted: Wed Dec 20, 2006 10:18 am
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..

Posted: Wed Dec 20, 2006 10:22 am
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.

Posted: Thu Dec 21, 2006 7:14 am
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.

Posted: Thu Dec 21, 2006 8:32 am
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 ..

Posted: Thu Dec 21, 2006 9:00 am
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.

Posted: Fri Dec 22, 2006 10:11 pm
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..

Posted: Sat Dec 23, 2006 9:57 pm
by kumar_s
Why cant you import the Imported table definition into CFF stage?