Need help ! generating a file with multiple header&trail

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
raju711001
Participant
Posts: 3
Joined: Mon Jan 12, 2004 11:39 am

Need help ! generating a file with multiple header&trail

Post by raju711001 »

I am reading from an oracle table and writing to a file but I have to have header and trailer for each ship from location.The Header has a certain format and so does trailer too ,which contains the ship from location info and trailer contains the record count. My problem is that though i can get the header ,trailer and body through 3 transformers and then try to funnel the 3 inputs into a file. but funnels need to have same meta data for all the input link and my all 3 inputs have different meta data. Even if i try to same it similar then the header and trailer format gets shuffled. How can I do it in a single job?
Any Inputs will be appreciated
Thanks in advance
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Use the correct tool. That's not what DataStage is designed to do.

If you must process header and trailer information, do it separately from the detail rows. Perhaps in other jobs or in commands or routines invoked from a job sequence.

1. Create the target files with the header information.
2. Append the detail rows.
3. Append the trailer information.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
jreddy
Premium Member
Premium Member
Posts: 202
Joined: Tue Feb 03, 2004 5:09 pm

Post by jreddy »

i had tried something similar, but using a server job, so see if you can work it around like this.
My requirement was that i had input detail records in the form
SNo Type Amount
1 TypeA 123
2 TypeB 456
3 TypeA 789
4 TypeC 999 ...and so on

Needed output to be in this form

1 TypeA 123
3 TypeA 789
TR TypeA 2
2 TypeB 456
TR TypeB 1
4 TypeC 999
TR TypeC 1 .........

Now, here i needed the same metadata.. in the sense 3 columns in detail as well as trailer..

my design had a oracle table to read details..transformer adn then the flat fiel to collect data

From the output link of the oracle table, i wrote this user-defined query

select sno, type, amount from jtest3
union
SELECT 'TR', Type, count(*) FROM jtest3 group by Type order by Type

See if you can implement something like this in your case.. maybe add some dummy cols extra to have same number of cols and just pass nulls or something in them..

my 2 cents..
Post Reply