Sequential File : Header generation

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
Deepakinstyle
Participant
Posts: 47
Joined: Wed Apr 18, 2007 4:49 am

Sequential File : Header generation

Post by Deepakinstyle »

Hi All,

My reqirement is to generate ASCII txt files from a table.
The file should have 2 headers in it. I have 3 o/p links from a transformer to 3 Seq file stage. one for each header and the last one for actual data. All headers are hardcoded(except one where am using a date from parameter), not connected to any i/p link.

But after run, the 2 header files had as many rows as in table.
eg: now i am testing with 3 records from table. and the hardcoded value for each header has been written to file 3 times.

Please help me out how to restrict header to only one row.

Thanks,
Deepak
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Constraint?

Code: Select all

@OUTROWNUM = 1
-craig

"You can never have too many knives" -- Logan Nine Fingers
Deepakinstyle
Participant
Posts: 47
Joined: Wed Apr 18, 2007 4:49 am

Post by Deepakinstyle »

chulett wrote:Constraint?

Code: Select all

@OUTROWNUM = 1
...
Hi Chulett,

I have tried @OUTROWNUM = 1 option, this time 2 header records are written to sequential file. But i need only 1 record.

thanks,
Deepak
keshav0307
Premium Member
Premium Member
Posts: 783
Joined: Mon Jan 16, 2006 10:17 pm
Location: Sydney, Australia

Post by keshav0307 »

use head stage and number of records 1.
Deepakinstyle
Participant
Posts: 47
Joined: Wed Apr 18, 2007 4:49 am

Post by Deepakinstyle »

keshav0307 wrote:use head stage and number of records 1.
Hi Keshav,

Thanks for your suggestion.
i have used options,
Allow all rows = FALSE
No Of Rows/Partition = 1

All Partitions = FALSE
No Of Partitions = 1

and it is working fine. Can you confirm are these options.

Thanks,
Deepak
keshav0307
Premium Member
Premium Member
Posts: 783
Joined: Mon Jan 16, 2006 10:17 pm
Location: Sydney, Australia

Post by keshav0307 »

if it is working fine then correct option only :D
Deepakinstyle
Participant
Posts: 47
Joined: Wed Apr 18, 2007 4:49 am

Post by Deepakinstyle »

keshav0307 wrote:if it is working fine then correct option only :D

Thanks Keshav
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

chulett wrote:Constraint?

Code: Select all

@OUTROWNUM = 1
Foiled by parallel execution!

Maybe

Code: Select all

@OUTROWNUM = 1 And @PARTNUM = 0
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply