re: splitting header and detail records in CFF stage

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

Post Reply
panic
Participant
Posts: 17
Joined: Fri Sep 23, 2005 5:58 pm

re: splitting header and detail records in CFF stage

Post by panic »

my question is how to split header and detail based on
on which record in my case i mean by which column (record type) where exactly i have to specify in stage that one and what value and where in the stage
actually that needs to be splitted in transformer according ly by record type
what is the record type in my case and can u please breif up how we resolve it please it would be of great help
and also iam sending the same file for both hdr job and detail job is that the right way
thanks


** ************ HEADER RECORD BEGINS HERE ************* *

01 ICH-4460-DIAGNOSIS-RECORD.

05 ICH-4470-DIAG-DATE-KEY.
10 ICH-4470-DIAGNOSIS-CODE PIC X(05).
10 ICH-4470-RECORD-TYPE PIC X(02).
88 ICH-4470-HEADER VALUE '01'.
88 ICH-4470-DETAIL VALUE '02'.
S22138 10 ICH-4428-CONTRACT-ORIGIN PIC X(02).
10 ICH-4332-LINE-OF-BUSINESS PIC X(02).
S22138 10 ICH-4103-BEN-PLN-RID-ID.
S22138 15 ICH-4104-PLN-RID-CTG-CD PIC X(01).
S22138 15 ICH-4105-PLN-RID-ID PIC X(05).
10 ICH-4470-EFF-DATE-C PIC 9(0.

05 ICH-4471-EFF-DATE PIC 9(0.

05 ICH-4462-RECORD-SEQUENCE-X.
10 ICH-4462-RECORD-SEQUENCE PIC 9(03).

05 ICH-1090-MAINTENANCE-INFO.

Y2K * 10 ICH-1091-RECORD-CREATION-DATE.
Y2K * 15 ICH-1091-CREATE-YY PIC 9(02).
Y2K * 15 ICH-1091-CREATE-MM PIC 9(02).
Y2K * 15 ICH-1091-CREATE-DD PIC 9(02).
Y2K 10 ICH-1091-CREATION-DATE-FLD.
Y2K 15 ICH-1091-FILLER PIC X.
Y2K 15 ICH-1091-RECORD-CREATION-DATE PIC 9( COMP-3.
10 ICH-1092-CREATE-TERMINAL PIC X(04).

10 ICH-1093-CREATION-OP-ID PIC X(04).

Y2K * 10 ICH-1094-LAST-CHANGE-DATE.
Y2K * 15 ICH-1094-LAST-CHANGE-YY PIC 9(02).
Y2K * 15 ICH-1094-LAST-CHANGE-MM PIC 9(02).
Y2K * 15 ICH-1094-LAST-CHANGE-DD PIC 9(02).
Y2K 10 ICH-1094-LAST-CHANGE-DATE-FLD.
Y2K 15 ICH-1094-FILLER PIC X.
Y2K 15 ICH-1094-LAST-CHANGE-DATE PIC 9( COMP-3.

10 ICH-1095-CHNG-TERMINAL PIC X(04).

10 ICH-1096-LAST-CHNG-OP-ID PIC X(04).

05 ICH-4477-DIAGNOSIS PIC X(2.
S20199 05 ICH-4477-ASTR-FLAG PIC X(01).
S20199 88 ICH-4477-ASTR-FOUND VALUE 'Y'.

RYC033 05 ICH-2297-DAYS-NUMB-ACC PIC 9(03).
RYC033 05 ICH-2299-SUBRO-MIN-AMT PIC 9(04)V99 COMP-3.

RYC033 05 FILLER PIC X(50).

************ DETAIL RECORD BEGINS HERE
01 ICD-4460-DIAGNOSIS-RECORD.

05 ICD-4470-DIAG-DATE-KEY.
10 ICD-4470-DIAGNOSIS-CODE PIC X(05).
10 ICD-4470-RECORD-TYPE PIC X(02).
88 ICD-4470-HEADER VALUE '01'.
88 ICD-4470-DETAIL VALUE '02'.
S22138 10 ICD-4428-CONTRACT-ORIGIN PIC X(02).
10 ICD-4332-LINE-OF-BUSINESS PIC X(02).
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

To avoid the header mention FirstLine is ColumnName.
To get only the header, Give Readfirst n row as 1.
Since the detail record has a set, pre process it.
grep the line number where "************ DETAIL RECORD BEGINS HERE" presents, and have a head -n to get those detail and header alone. And again you can exclude the header with the above mentioned methods.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
panic
Participant
Posts: 17
Joined: Fri Sep 23, 2005 5:58 pm

Post by panic »

Thanks kumar
so u mean the file should be splitted before using it as a source file to the cff stage according to the copy book and also where should i mention the record type in cff
i mentioned at the redefined field and value in the cff
it would be of great help kumar

thanks
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Sorry I have misunderstood your requirement at first glance. :oops:

Still you can use Readfirst n row as 1 where you need to process the Header alone.
And FirstLine is ColumnName option to skip the Header for processing Detail alone.
Optionally you can check the condition in the transformer after reading it,

ICH-4470-RECORD-TYPE = '01 ---> Header Link.
ICH-4470-RECORD-TYPE = '02' ----> Detail Link.

If the source is ebcidic you need to avoid preprocessing. If it is ascii you have another option of playing with filter option.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
Post Reply