Reading Multiformat Cobol File

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
ds2000
Premium Member
Premium Member
Posts: 109
Joined: Sun Apr 22, 2007 7:25 pm
Location: ny

Reading Multiformat Cobol File

Post by ds2000 »

Im using cobol files first time for extraction. I loaded the cobol file definitions with following copybook.

How can i read the data for different tables. If i can filter for each record type ? When i tried sequential file there was some binary data comming up but when I tried Peek to see the data there was no binary data in it. see blow:
----------------------
Peek_29,1:
TRANSACTION_KEY_C702:(TRANSACTION_KEY_C702.ACCOUNT_NO_C702:250412145
TRANSACTION_KEY_C702.TRAN_NO_C702:215515
TRANSACTION_KEY_C702.RISK_NO_C702: 025.
TRANSACTION_KEY_C702.RECORD_TYPE_C702:10)
FILLER_2:
DATA_PORTION_C702: R NFLLIFE0080 2008051120090511200805112008051000000000


----------------------------
Copybook
------------
*
01 STD-RECORD-Z100.
05 TRANSACTION-KEY-Z100.
10 ACCOUNT-NO-Z100 PIC X(12).
10 TRAN-NO-Z100 PIC X(08).
10 RISK-NO-Z100 PIC 9(03).
10 RECORD-TYPE-Z100 PIC X(02).
88 HEADER-REC-Z100 VALUE '00'.
88 ACCOUNT-REC-Z100 VALUE '10'.
05 FILLER PIC X(05).
05 DATA-PORTION-Z100 PIC X(450).
*
05 HEADER-DATA-Z100 REDEFINES DATA-PORTION-Z100.
10 FILLER PIC X(20).
10 HDR-VENDOR-Z100 PIC X(10).
10 HDR-VENDOR-LITEX-Z100 PIC X(10).
10 HDR-SOURCE-Z100 PIC X(01).
88 FILE-FROM-VENDOR-Z100 VALUE 'B'.
88 FILE-FROM-WEB-Z100 VALUE 'W'.
10 HDR-BATCH-NO-Z100 PIC X(08).
10 HDR-LAST-BATCH-NO-Z100 PIC X(08).
10 HDR-CREATE-DATE-Z100 PIC 9(08).
10 HDR-CREATE-TIME-Z100 PIC 9(08).
10 FILLER PIC X(377).
*
05 ACCOUNT-DATA-Z100 REDEFINES DATA-PORTION-Z100.
10 FILLER PIC X(20).
10 ACT-TRANTYPE-Z100 PIC X(01).
88 NEW-BUSINESS-Z100 VALUE 'N'.
88 AMENDMENT-Z100 VALUE 'A'.
88 RENEWAL-Z100 VALUE 'R'.
88 CANCELLATION-Z100 VALUE 'C'.
88 REINSTATEMENT-Z100 VALUE 'I'.
10 ACT-LAST-TRAN-NO-Z100 PIC X(08).
10 ACT-PRODUCT-Z100 PIC X(03).
10 ACT-CLASS-Z100 PIC X(03).
10 ACT-SUBCOY-Z100 PIC 9(04).
10 ACT-STATUS-Z100 PIC X(01).
10 ACT-TERMINCEP-Z100 PIC 9(08).
10 ACT-DUEDATE-Z100 PIC 9(08).
10 ACT-EFFECTDTE-Z100 PIC 9(08).
10 ACT-TRANDATE-Z100 PIC 9(08).
10 ACT-TRANTIME-Z100 PIC 9(08).
10 ACT-TRANUSER-Z100 PIC X(08).
10 ACT-ANNUALPRM-Z100 PIC S9(9)V99 COMP-3.
10 ACT-TRANPRM-Z100 PIC S9(9)V99 COMP-3.
10 ACT-CURRENTPRM-Z100 PIC S9(9)V99 COMP-3.
10 ACT-RCOMMISN-Z100 PIC S9(9)V99 COMP-3.
10 ACT-TCOMMISN-Z100 PIC S9(9)V99 COMP-3.
10 ACT-CCOMMISN-Z100 PIC S9(9)V99 COMP-3.
10 ACT-COMMRATE-Z100 PIC 9(03).
10 ACT-TRAN-STATUS-Z100 PIC X(01).
88 INCOMPLETE-Z100 VALUE 'I'.
88 NEW-ENTRY-Z100 VALUE 'N'.
88 LOADED-INTO-HUON-Z100 VALUE 'L'.
88 REJECTED-Z100 VALUE 'R'.
88 CORRECTED-Z100 VALUE 'C'.
88 SUBMITTED-Z100 VALUE 'S'.
88 DISCARDED-Z100 VALUE 'D'.
10 ACT-HUON-ACCOUNT-NO-Z100 PIC 9(12).
10 ACT-BUSTRNNO-Z100 PIC 9(04).
10 FILLER PIC X(306).
*
ds2000
Premium Member
Premium Member
Posts: 109
Joined: Sun Apr 22, 2007 7:25 pm
Location: ny

Post by ds2000 »

Any Comments !! :roll:
shaonli
Participant
Posts: 80
Joined: Tue Nov 28, 2006 6:52 am

Post by shaonli »

Please check the character set.In my case also when I was using Compex file stage for reading cobolfile ftp ed from M/F server,the binary data was viewing until I change the character set to ASCII.
So please check it.
ds2000
Premium Member
Premium Member
Posts: 109
Joined: Sun Apr 22, 2007 7:25 pm
Location: ny

Post by ds2000 »

Actual problem is to extract the data for different tables. How can i do this.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

In version 7.x, you can only use separate CFF stage for each table. In version 8.x one CFF stage can have different outputs for different tables.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
pneumalin
Premium Member
Premium Member
Posts: 125
Joined: Sat May 07, 2005 6:32 am

Post by pneumalin »

If you have not upgraded to 8.x, you may have to use Server job CFF to extract all formats since PX CFF can extract one format at a time. Notes that Server job CFF extract all formats into one flatten record layout, and you have to identify every format via certain record type column using transformer stage.
Post Reply