How to include Header row in sequential file

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
bsreenu
Participant
Posts: 22
Joined: Mon Aug 16, 2004 3:57 pm

How to include Header row in sequential file

Post by bsreenu »

Hi,

Can someone please tell me How to include header row while wiriting into a sequential flat file.


Ex: The seq. file should be look like this

EMPNO|EMPNAME|DEPT
123|JOHN XYZ|150
234|XYX ABC|201

I'm able to create and write data into seq. file, but the header is missing. Is there any option in "seq file stage" to include header row.
Please let me know if there any other alternates.

I appreciate your help.
phanee_k
Charter Member
Charter Member
Posts: 68
Joined: Thu Nov 20, 2003 11:02 pm

Post by phanee_k »

In the format tab of Sequential File in Input tab , select the check box against " First Line is Column Names " and run the job.

HTH
Someswar Barkataki
Participant
Posts: 6
Joined: Tue Jul 13, 2004 7:40 am

Post by Someswar Barkataki »

That is true for server jobs. Phanee, could you explain how we set that for parallel job?

Thanks,
Somesh
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Perhaps a before-job subroutine to write the header, then your Sequential File stage appends to the existing file.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
sjordery
Premium Member
Premium Member
Posts: 202
Joined: Thu Jun 08, 2006 5:58 am

Re: How to include Header row in sequential file

Post by sjordery »

We try to write a small job which uses a row generator to a file, and then in the second job in the sequence, we just append to the existing file. this works well for all cases where you need some text before the value and will work for header columns as well - you just define the header column as a varchar string and in the derivation, just put this string...
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

In the parallel Sequential File stage the "First line is header rows" property is a General property, not a Format property. On the Properties tab you will find it in the Options folder.
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