Add Header information and add page breaks into the sequenti

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Use a reporting tool
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
creatingfusion
Participant
Posts: 46
Joined: Tue Jul 20, 2010 1:26 pm
Location: USA
Contact:

Post by creatingfusion »

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
arunkumarmm
Participant
Posts: 246
Joined: Mon Jun 30, 2008 3:22 am
Location: New York
Contact:

Post by arunkumarmm »

I believe he wants to write the header in all of his pages [??]. :idea:

Cant you include the header detail to your Pages 2 & 3 as you do it for your page 1??

If this is not what you are looking for, please post more details.
Arun
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

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
arunpramanik
Participant
Posts: 63
Joined: Fri Jun 22, 2007 7:27 am
Location: Kolkata

Post by arunpramanik »

What about the page break?
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

arunpramanik wrote:What about the page break?
What about it ?
Post Reply