Reading Cobol File using CFF Stage
Posted: Thu May 03, 2007 5:27 am
Hi Friends,
I was trying to read through a Cobol File which has a occur clause in it. I tried to read data using the complex flat file stage.
I am able to read the file however datastage is not able to filter the group according to the occur clause.
Ex.
05 FIELD-A PIC X(4)
05 FIELD-E PIC 9(02)
05 FIELD-B OCCURS 0-5 TIMES depending on the value of E
10 FIELD-C PIC X(4)
10 FIELD-D PIC X(4)
In this example I want datastage to read the value of field E and repeat the group B as many times as its value.
If the value of E is ZERO(0)
The reading of the file should be like
FIELD-A, FIELD-E (Group B does not occur as E is 0)
If the value of E is One(1)
The reading of the file should be like
FIELD-A,FIELD-E,FIELD-C,FIELD-D
If the value of E is Two(2)
The reading of the file should be like
FIELD-A,FIELD-E,FIELD-C,FIELD-D,FIELD-C_1,FIELD-D_1
And so on...!
However I am not able to achieve this even after specifying the occurs depending on clause in the stage properties.
Kindly, Help...!!!
Thanks
Ramesh
I was trying to read through a Cobol File which has a occur clause in it. I tried to read data using the complex flat file stage.
I am able to read the file however datastage is not able to filter the group according to the occur clause.
Ex.
05 FIELD-A PIC X(4)
05 FIELD-E PIC 9(02)
05 FIELD-B OCCURS 0-5 TIMES depending on the value of E
10 FIELD-C PIC X(4)
10 FIELD-D PIC X(4)
In this example I want datastage to read the value of field E and repeat the group B as many times as its value.
If the value of E is ZERO(0)
The reading of the file should be like
FIELD-A, FIELD-E (Group B does not occur as E is 0)
If the value of E is One(1)
The reading of the file should be like
FIELD-A,FIELD-E,FIELD-C,FIELD-D
If the value of E is Two(2)
The reading of the file should be like
FIELD-A,FIELD-E,FIELD-C,FIELD-D,FIELD-C_1,FIELD-D_1
And so on...!
However I am not able to achieve this even after specifying the occurs depending on clause in the stage properties.
Kindly, Help...!!!
Thanks
Ramesh