Add Header information and add page breaks into the sequenti
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
Let's get the first comment that you were going to get from someone out of the way - DataStage is an ETL tool, not a BI tool and what you have is not an ETL task. Does your company not have access to a BI tool, some kind of 'report writer' that would do a proper job of this?
Otherwise what you have is a sorting issue. Add fields to the flow that hold the page and line numbers which will allow you to generate the data in any convenient order. Then a sort stage can put them in the proper output order and you can drop those fields before the final write.
Otherwise what you have is a sorting issue. Add fields to the flow that hold the page and line numbers which will allow you to generate the data in any convenient order. Then a sort stage can put them in the proper output order and you can drop those fields before the final write.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 46
- Joined: Tue Jul 20, 2010 1:26 pm
- Location: USA
- Contact:
create the header file in one sequential file seperately. then get the detail files as per yours requirement.
Then use shell script as after job subroutine to append the detail files to the header file.
I hope this would work fine as per yours requirement.
To append the header and detail files you may use the following unix command in yours shell script.
cat header_file_name detail_file_name > output_file
Let me know if this serves yours requirement.
Abhijit
Then use shell script as after job subroutine to append the detail files to the header file.
I hope this would work fine as per yours requirement.
To append the header and detail files you may use the following unix command in yours shell script.
cat header_file_name detail_file_name > output_file
Let me know if this serves yours requirement.
Abhijit
-
- Participant
- Posts: 246
- Joined: Mon Jun 30, 2008 3:22 am
- Location: New York
- Contact:
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
If you really want to go down this route, extend the (psuedo) code below
Code: Select all
awk '{ if ((NR%49) == 1) printf("%s\n",yourHeader)} {printf("%s\n",$0) } ' yourFileName
-
- Participant
- Posts: 63
- Joined: Fri Jun 22, 2007 7:27 am
- Location: Kolkata
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom