
Anonymous
Not applicable
2011-05-24
03:38 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
how to Create header, detail and trailer record in a file using talend
Hi,
I have N no of records in a table and write it into a positional file which has the following format:
Header record layout
-------------------------
currentdate 1-6
Detail record layout
------------------------
ename 1-10
esal 11-18
trailer layout
-----------------
Totalsal 1-10
sample output file
--------------------
2011-24-05
ganesh 0001000
shong 0002000
00003000
So my output file is, one header entry, one trailer entry and multiple detail entries.
I have N no of records in a table and write it into a positional file which has the following format:
Header record layout
-------------------------
currentdate 1-6
Detail record layout
------------------------
ename 1-10
esal 11-18
trailer layout
-----------------
Totalsal 1-10
sample output file
--------------------
2011-24-05
ganesh 0001000
shong 0002000
00003000
So my output file is, one header entry, one trailer entry and multiple detail entries.
271 Views
7 Replies

Anonymous
Not applicable
2011-05-25
12:12 AM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
You need to write the header, trailer and details entries into the same file one by one with the feature 'append source file'.
Best regards
Shong
You need to write the header, trailer and details entries into the same file one by one with the feature 'append source file'.
Best regards
Shong
271 Views

Anonymous
Not applicable
2011-05-25
03:39 AM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can u plz put some screenshots? Because i can't able to implement this one.
271 Views

Anonymous
Not applicable
2011-05-25
05:54 AM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
The job looks like:
extract the header data from a data source or use the tFixedFlowInput to define the header data --main-->tFileOutputPositional_1
|
onsubjobok
|
extract the Detail data from a data source or use the tFixedFlowInput to define the header data--main---tFileOutputPositional_2(write the records into the same file and check the option 'Append')
|
onsubjobok
|
extract the trailer data from a data source or use the tFixedFlowInput to define the header data--main---tFileOutputPositional_3(write the records into the same file and check the option 'Append')
Best regards
Shong
The job looks like:
extract the header data from a data source or use the tFixedFlowInput to define the header data --main-->tFileOutputPositional_1
|
onsubjobok
|
extract the Detail data from a data source or use the tFixedFlowInput to define the header data--main---tFileOutputPositional_2(write the records into the same file and check the option 'Append')
|
onsubjobok
|
extract the trailer data from a data source or use the tFixedFlowInput to define the header data--main---tFileOutputPositional_3(write the records into the same file and check the option 'Append')
Best regards
Shong
271 Views

Anonymous
Not applicable
2011-05-26
09:04 AM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your valuable suggestions. I need a output file which has the following format:
Main Header (1st line)
Batch Header(2nd Line)
Record1 (3rd line)
Record 2 (4th line)
.
.
.
Record N (n+4th line)
Batch Trailer(n+5th line)
Batch Header(n+6th line)
Record1 ((n+7th line)
Record 2 (n+8th line)
.
.
.
Record N
Batch Trailer
FileTrailer(last line)
Main Header - contains the current date
Batch header - sequence number ( 1 for Header 1)
record - amount (fetch from db)
Batch trailer - (Batch Amount Total)
File Trailer - (File Amount Total)
N - no of records in a batch
Ex:
---
23/11/2011
1 (Batch No)
12 (record1)
8 (record2)
20 (Batch1 Amount Total)
2(Batch No)
30 (record3)
20 (record4)
50 (Batch2 Amount Total)
70 (File Amount overall Total)
Please reply ASAP. Thanks in advance.
Main Header (1st line)
Batch Header(2nd Line)
Record1 (3rd line)
Record 2 (4th line)
.
.
.
Record N (n+4th line)
Batch Trailer(n+5th line)
Batch Header(n+6th line)
Record1 ((n+7th line)
Record 2 (n+8th line)
.
.
.
Record N
Batch Trailer
FileTrailer(last line)
Main Header - contains the current date
Batch header - sequence number ( 1 for Header 1)
record - amount (fetch from db)
Batch trailer - (Batch Amount Total)
File Trailer - (File Amount Total)
N - no of records in a batch
Ex:
---
23/11/2011
1 (Batch No)
12 (record1)
8 (record2)
20 (Batch1 Amount Total)
2(Batch No)
30 (record3)
20 (record4)
50 (Batch2 Amount Total)
70 (File Amount overall Total)
Please reply ASAP. Thanks in advance.
271 Views

Anonymous
Not applicable
2011-05-30
08:47 AM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Any Updates?
271 Views

Anonymous
Not applicable
2011-05-31
10:48 AM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
I have replied you and give an example job in previous post, have you tried to create the job? Do you understand the 'append' option?
Best regards
Shong
I have replied you and give an example job in previous post, have you tried to create the job? Do you understand the 'append' option?
Best regards
Shong
271 Views

Anonymous
Not applicable
2011-05-31
11:25 AM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I got the earlier one. But plz see the latest one. How can we populate dynamic dynamic batch with fixed set of records?
271 Views
