FIle extract Issues

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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Your file is, therefore, NOT fixed width. Specify that your file has two fields, one a Char field 19 characters long, the other a suitably large or even unbounded VarChar.

In a Transformer parse the first field into specific fields using substring techniques. Process the delimited list using (for example) looping within the Transformer stage. Depends, really, on what you want to do with these values.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
anudeepdasari001
Participant
Posts: 58
Joined: Mon Dec 14, 2015 3:16 pm
Location: Arizona

Post by anudeepdasari001 »

ray.wurlod wrote:Your file is, therefore, NOT fixed width. Specify that your file has two fields, one a Char field 19 characters long, the other a suitably large or even unbounded VarChar.

In a Transformer parse t ...


Hello Ray,

I cannot see your Full message, Could you please repost.
anudpETL
forest416
Participant
Posts: 3
Joined: Thu Dec 11, 2003 2:05 pm

Post by forest416 »

1. Read the whole one in one big field, field length long enough to capture the longest line.
2. use sub string function to split 1 to 18th field, use the '[ ]' operator
3. for the 19th field, split the value though field() function, using ',' as field separator.

If the sub-field count (comma delimitered ) is not fix, pivot stage can help to convert field to rows -- by principle 3rd normal form, the sub-field values in 19th field should be in another table.
anudeepdasari001
Participant
Posts: 58
Joined: Mon Dec 14, 2015 3:16 pm
Location: Arizona

Post by anudeepdasari001 »

What do you mean by 19th field should be in another table? Could you please be bit clear. What i did right now is bought the file record as two fields, one from 1-18 and 19th, And in transformer I separated 1-18 fields using [], and now i want to do this,

Code: Select all

1001430016 107S2 D2     19,20,


1001430016 1 07 S 2 D2  19
1001430016 1 07 S 2 D2  20
How to implement this logic, because ,comma is separated the values in the last field, and there might be three, four so on values in the last fields.
anudpETL
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Looping in Transformer stage to parse through the delimited fields. Plenty of examples in the documentation.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply