Page 1 of 1

Header and Trailer with zero records

Posted: Fri Apr 08, 2011 3:34 am
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,

Posted: Fri Apr 08, 2011 3:48 am
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.