Page 1 of 1

Sub-Record occurs 6 times in main record....Cobol file

Posted: Tue Mar 28, 2006 11:52 pm
by anu123
Good morning gurus.

In my cobol source file, I have a Sub-Record in Main-Record.Sub-Record contains 5 columns and this Sub-Record occurs for 6 times in Main-Record.I need to load this Sub-Record info into a seperate table.

My question is.....
How to load these 6 Sub-Records(containing 5 columns each) which are in a single row in source file,into my table as 6 seperate rows.(I have some other keys apart from these 5 columns to make each row unique).

thanks in advance,

Posted: Wed Mar 29, 2006 12:01 am
by balajisr
You can use row splitter to split your 6 concatenated subrecord rows into a 6 seperate rows.

Posted: Wed Mar 29, 2006 12:02 am
by loveojha2
Your case is of Horizontal pivoting.
You can use Pivot stage for this.
Search the fourm for Pivot stage.

Posted: Wed Mar 29, 2006 1:58 pm
by anu123
balajisr wrote:You can use row splitter to split your 6 concatenated subrecord rows into a 6 seperate rows.
Balaji,

Could you please elaborate a bit more on how to split them into 6 seperate rows...

lovejha2:

I work in that direction and let u update, thanks,

Posted: Wed Mar 29, 2006 2:58 pm
by ray.wurlod
If you use a Complex Flat File stage you can specify exactly how the repeating group is to be handled - in your case normalized.

Posted: Wed Mar 29, 2006 10:45 pm
by balajisr
anu123 wrote:
balajisr wrote:You can use row splitter to split your 6 concatenated subrecord rows into a 6 seperate rows.
Balaji,

Could you please elaborate a bit more on how to split them into 6 seperate rows...

lovejha2:

I work in that direction and let u update, thanks,
Anu,

Row splitter is a stage which comes as part of plug in. It basically reads a string and splits the string into required number of columns of columns

Eg. Input String: 10x10y10z(Has three rows with two columns each concatenated into one string)

With "multiple lines" option in splitter stage
Your output will be
Key Col1
10 x
10 y
10 Z

You can view the documentation of this stage in plug in book shelf.

Posted: Fri Mar 31, 2006 9:21 am
by thurmy34
Anu,
If you have a copybook,just import it in DS (without the comments) and load it in a CFF stage.
The redefine columns will appear like regular ones.
You have to pay attention if the redefine is include in a occurs.
In that case the redefine column is set to the column of the first occurs.
You can fix that with the edit row command in the CFF stage.

Posted: Tue Apr 04, 2006 7:26 pm
by anu123
thurmy34 wrote:Anu,
If you have a copybook,just import it in DS (without the comments) and load it in a CFF stage.
The redefine columns will appear like regular ones.
You have to pay attention if the redefine is include in a occurs.
In that case the redefine column is set to the column of the first occurs.
You can fix that with the edit row command in the CFF stage.
thanks every one. I do not have Cobol File Definitions(.cfd). So Iam reading the source as a fixed width file from Sequential Stage.actually Sub-record is in OCCURS. I am working on to use Row-Splitter.

please guide if you have any other options...

thanks in advacne

Posted: Sun Apr 16, 2006 7:37 am
by vijayrc
ray.wurlod wrote:If you use a Complex Flat File stage you can specify exactly how the repeating group is to be handled - in your case normalized.
Ray, can you please elaborate on this a little bit more..I use complex flat file stage for my cobol file and I''m interesting in knowing how repeating groups handling by CFF is to be done. Thanks in advance. -Vj