file count

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
agpt
Participant
Posts: 151
Joined: Sun May 16, 2010 12:53 am

file count

Post by agpt »

Hi,

I have an input file whose number of records keep on varying. I need to capture these number of records and assign it to one column. how can I achieve this?
anbu
Premium Member
Premium Member
Posts: 596
Joined: Sat Feb 18, 2006 2:25 am
Location: india

Post by anbu »

Pass the value of this command as parameter to your job and assign it to the target column

Code: Select all

wc -l < File
You are the creator of your destiny - Swami Vivekananda
agpt
Participant
Posts: 151
Joined: Sun May 16, 2010 12:53 am

Post by agpt »

thnx anbu,

can u pls tell me how do i exactly make parameter out of this command? is it using exec command stage?
anbu
Premium Member
Premium Member
Posts: 596
Joined: Sat Feb 18, 2006 2:25 am
Location: india

Post by anbu »

Either you can use Exec stage

Or

If you are using unix script to call dsjob, then you can execute the command in your unix script and pass it as parameter to the job.
You are the creator of your destiny - Swami Vivekananda
agpt
Participant
Posts: 151
Joined: Sun May 16, 2010 12:53 am

Post by agpt »

And what options i need to set to specify that this particular value would come at run time from parameter?
sivanagu
Participant
Posts: 5
Joined: Sun May 29, 2005 4:46 pm

Post by sivanagu »

did u get solution.
agpt
Participant
Posts: 151
Joined: Sun May 16, 2010 12:53 am

Post by agpt »

sivanagu wrote:did u get solution.

not yet
sivanagu
Participant
Posts: 5
Joined: Sun May 29, 2005 4:46 pm

Post by sivanagu »

create shl script file with below steps

1) define variable and assign count
Val1=`wc -l < /auto/temp_file.txt`

2) define param list and with this veriable
ParamList="-param ABCD=$Val1"

3) call dsjob pass the paramlist
dsjob -run -mode NORMAL $ParamList <PROJECT> <JOB NAME>

4) define parameter in data stage job

5) assign job parameter to column.
Post Reply