row count header to the sequential file

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

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

Post by chulett »

Sheesh. Why not simply split off a link to an Aggregator, write the count to a header file and cat the two together after job. No pesky script required.
-craig

"You can never have too many knives" -- Logan Nine Fingers
sbass1
Premium Member
Premium Member
Posts: 211
Joined: Wed Jan 28, 2009 9:00 pm
Location: Sydney, Australia

Post by sbass1 »

reshma11 wrote:I have a source oracle table,transformer and sequentail file. when i run this job i want to see number of records count + all records in sequentail file.

row count: 2

column1 column2
1 XXXX
2 XXX
Show us 1) exactly what you have (your source), and 2) exactly your desired output (your reformatted source).

Wrap your post in code tags, which will preserve formatting (basically using monospaced font for the code block, example):

Code: Select all

column1  column2
1        XXXX
2        XXX
I've done this sort of thing recently, so could possible help if I knew what you need.

In my case, it was to test for partial/failed FTP's, where the file already contained a header with the number of expected records. So in my case, I chose to use a Unix script, and abort if actual records <> expected records.
Some people are the Michael Jordan's of Datastage. I'm more like Muggsy Bogues :-)
reshma11
Premium Member
Premium Member
Posts: 25
Joined: Mon Oct 13, 2008 7:52 am

it is working

Post by reshma11 »

#!/bin/ksh
$var
var=`cat /***/***/test.txt | wc -l`
echo "row count : $var" > /***/**/test1.txt
cat /***/***/test1.txt >> /****/***/test.txt

Thank you.
Post Reply