HI Everyone,
Before posting this topic i did searched for my requirement without any luck.
can anyone help me how to create a Sequential file with a Header and Trailer(Count) in a sequential file?
My requirement would be
Header(This is a Test File)
Record 1
Record 2
Trailer 2
where Trailer 2 is the sum of all the records in the sequentail file.
Thans in Advance for your help.
Vee Yes
HOw to Create a Header and Trailer for a Sequential file?
Moderators: chulett, rschirm, roy
HOw to Create a Header and Trailer for a Sequential file?
Man Has Created Money...Its not Money which has created Man....
Sri,
There are two methods of creating the Header and trailer to a file.
1) Manual
2) Automated
In manual process you have to manually amend the header and trailer to the file.
In an automated system send a file as in input to the system, the out come of that would be an header and trailer added to it, with the appropriate count in the trailer record.
Hope this helps you.
In most of the cases this process is automated.
There are two methods of creating the Header and trailer to a file.
1) Manual
2) Automated
In manual process you have to manually amend the header and trailer to the file.
In an automated system send a file as in input to the system, the out come of that would be an header and trailer added to it, with the appropriate count in the trailer record.
Hope this helps you.
In most of the cases this process is automated.
Regards,
Shree
785-816-0728
Shree
785-816-0728
HI All,
Thanks for your reply...
I am pulling data from Oracle and Dropping on a sequential file....
In normal scenario we would only have the data with Only the Detail records, Our requirement is to add a Header and Trailer to count the no of records in the file.
Thanks
Vee Yes
Thanks for your reply...
I am pulling data from Oracle and Dropping on a sequential file....
In normal scenario we would only have the data with Only the Detail records, Our requirement is to add a Header and Trailer to count the no of records in the file.
Thanks
Vee Yes
Man Has Created Money...Its not Money which has created Man....
One option is-
Trailer record count:
Create dummy column along with your target fields derivations. Take an aggregator and take this dummy column as an input.In the aggregator select the 'aggregation type' as 'Count Rows' and give this column as an input to this and pass the output to the target.
Eg: ORacle stage-->transformer1-->aggregator(for record count),column export(detail records)---> funnel1.
Header:
OracleStage --> transformer1(hardcode the header desc)-->funnel1
Done!
Trailer record count:
Create dummy column along with your target fields derivations. Take an aggregator and take this dummy column as an input.In the aggregator select the 'aggregation type' as 'Count Rows' and give this column as an input to this and pass the output to the target.
Eg: ORacle stage-->transformer1-->aggregator(for record count),column export(detail records)---> funnel1.
Header:
OracleStage --> transformer1(hardcode the header desc)-->funnel1
Done!
Thanks and Regards!!
dspxlearn
dspxlearn
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Depends what has to be in them. If the header is fixed text, for example, you could set up a before-job subroutine to use echo command. The Sequential File stage in your job would then be set to append, rather than to overwrite. Similarly trailer could be an operating system command that picks up the record count written to a temporary file by the job.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.