Header and Trailer with zero records

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
ssangireddy
Participant
Posts: 4
Joined: Tue May 05, 2009 2:38 am

Header and Trailer with zero records

Post by ssangireddy »

Hi

I am trying to build an extract file with header and trailer records.

Header comes from an audit table
Header and trailer are almost same except that the trailer has no of records in the file (detail records)
I have completed a sample job and its working fine except when there are zero records for the extract. When we have zero records for the extracts its only generating a header and the final extract is having only one record (header). I need to have both header and trailer records even if there are no records for the extract (Add '0' as number of records in trailer)

Sample extract with 1 record:

01|Date!
05|DetailRecord
99|Date|1

Sample extract with 0 records:
01|Date!
99|Date|0

I am currently using column export and funnel (Sequence type) to build the extract.

Appreciate your help.

Thank you,
Shankar
GJ_Stage
Participant
Posts: 131
Joined: Mon Oct 27, 2008 6:59 am

Post by GJ_Stage »

You can make one check condition in transformer stage if first column !='05' then assign 0 in stage variable and use Row generator stage for Trailer and keep this calculated stage variable on this.
Post Reply