Execute Command activity Orchadmin dump single value output

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
ecclesr
Premium Member
Premium Member
Posts: 260
Joined: Sat Apr 05, 2003 7:12 pm
Location: Australia

Execute Command activity Orchadmin dump single value output

Post by ecclesr »

In some previous sequences I have use Execute Command activity to execute Orchadmin untility dsrecords -n to return the number of rows in a dataset

I am now dealing with a sequence where i want to use Execute Command activity Orchadmin dump command and only return a single column value just as dsrecords -n does

I am able to run the command but expect I am getting more that one line returned as I do when I run the command line in Unix

Has anyone a work around for this to return a single value

Thanking you all in advance
qt_ky
Premium Member
Premium Member
Posts: 2895
Joined: Wed Aug 03, 2011 6:16 am
Location: USA

Post by qt_ky »

What kind of value are you expecting the orchadmin dump to return? Have you tried using the grep command on the output?
Choose a job you love, and you will never have to work a day in your life. - Confucius
ecclesr
Premium Member
Premium Member
Posts: 260
Joined: Sat Apr 05, 2003 7:12 pm
Location: Australia

Post by ecclesr »

I am expecting back 1 value from a single column single row DataSet

My current orchadmin

$APT_ORCHHOME/bin/orchadmin dump /.../.../xx.ds | tr -d \n

When I look at the sequence log I see

Output from command ====>
##I XXX <main_program>
IBM InfoSphere DataStage Enterprise Edition .....
xxxxx..


##I IIS-DSEE-TUTL....
##I IIS-DSEE-TFCN....
##I IIS-DSEE-TFSC....
##I IIS-DSEE-TOIX....
##I IIS-DSEE-TFSC....

1


In the above case I expect Output

Output from command ====>
1
qt_ky
Premium Member
Premium Member
Posts: 2895
Joined: Wed Aug 03, 2011 6:16 am
Location: USA

Post by qt_ky »

To suppress the noise, redirect standard error to /dev/null so that you are left with only the standard output.

Code: Select all

$APT_ORCHHOME/bin/orchadmin dump /.../.../xx.ds 2>/dev/null
Here is a page about Standard Input and Output Redirection.

http://sc.tamu.edu/help/general/unix/redirection.html
Choose a job you love, and you will never have to work a day in your life. - Confucius
Post Reply