How to splite Header from the file

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
ravindrag
Participant
Posts: 40
Joined: Wed Dec 14, 2005 3:22 am

How to splite Header from the file

Post by ravindrag »

Hi all,

i have to splite Header from the file and this Header i have to send onther file

Thanx inadance
gateleys
Premium Member
Premium Member
Posts: 992
Joined: Mon Aug 08, 2005 5:08 pm
Location: USA

Post by gateleys »

Assuming the header is the first row in the file, use a transformer with 2 output links. To get rows minus the header, use the constraint @INROWNUM > 1, and to get only the header row, use @INROWNUM = 1.

gateleys
DeepakCorning
Premium Member
Premium Member
Posts: 503
Joined: Wed Jun 29, 2005 8:14 am

Post by DeepakCorning »

Or if you have a header format such as HDRdatetimeatmp then set a flag saying if input such as HDR then set the flag "Y" or "N" and pass the rows respectively.

The above solution is perfect but I had situations where the "headers" where every where in the file :)
kris007
Charter Member
Charter Member
Posts: 1102
Joined: Tue Jan 24, 2006 5:38 pm
Location: Riverside, RI

Post by kris007 »

Can you mention what is the problem you are facing when trying to do what gateleys has suggested? Is your input file a fixedwidth file? Also, since you need to send the header data to a seperate file, all would need do it is to map three columns in question to three columns onto the file in the Transformer Stage or concatenate those three columns into a single column based upon your requirement.
Kris

Where's the "Any" key?-Homer Simpson
Kirtikumar
Participant
Posts: 437
Joined: Fri Oct 15, 2004 6:13 am
Location: Pune, India

Post by Kirtikumar »

If your file has different format of the header and other records i.e. metadata for header and other records - then you might have to use a bit diff approach.

In this case, you can read the whole line in a single varchar column and then as suggested separate out header and other records based on INROWNUM. Then after this you can use row splitter to split multiple cols from single col.
Regards,
S. Kirtikumar.
ravindrag
Participant
Posts: 40
Joined: Wed Dec 14, 2005 3:22 am

Post by ravindrag »

Ae go re go
kris007
Charter Member
Charter Member
Posts: 1102
Joined: Tue Jan 24, 2006 5:38 pm
Location: Riverside, RI

Post by kris007 »

What does that mean :?
Kris

Where's the "Any" key?-Homer Simpson
DeepakCorning
Premium Member
Premium Member
Posts: 503
Joined: Wed Jun 29, 2005 8:14 am

Post by DeepakCorning »

Hmmm sounds like a different Language to me :D
Post Reply