Page 1 of 1

Need help ! generating a file with multiple header&trail

Posted: Mon Feb 02, 2004 5:43 pm
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

Posted: Mon Feb 02, 2004 7:43 pm
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.

Posted: Tue Feb 24, 2004 8:30 am
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..