Header, detail, and trailer records

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
btmorris3
Participant
Posts: 4
Joined: Fri Jul 30, 2004 7:47 am

Header, detail, and trailer records

Post by btmorris3 »

I'm trying to create a file with header records, detail records, and trailer records. I'm pulling all the data from one table, then I need to sort by a given field, then for each record with matching values in that field, I need to write a header record, all the datail records, then a trailer record with a count of the detail records. Is there an easy way to do this?

<HEADER_STRa><HEADER_DATE>
<DETAILa1>
<DETAILa2>
<DETAILa3>
<TRAILERa><RECORD_COUNT>
<HEADER_STRb><HEADER_DATE>
<DETAILb1>
<DETAILb2>
<DETAILb3>
<TRAILERb><RECORD_COUNT>

Thanks
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Easy? Not really, but it doesn't have to be all that complicated. You should check this post for ideas. Searches will turn up other conversations on the topic as you're not the first to have to tackle this.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply