commandoutput

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
times29
Premium Member
Premium Member
Posts: 202
Joined: Mon Sep 22, 2008 3:47 pm

commandoutput

Post by times29 »

Hi,

1)i am doing grep in execute command activity
getting
Output from command ====>
"all_v1"

2) Using nested condition
to load table_a

Activity.$CommandOutput = 'all_v1'

table_a not getting loaded any idea what should be nested condition.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Command Output is a dynamic array so there a Field Marks included that are causing your comparison to fail. Try array notation:

Code: Select all

Activity.$CommandOutput<1> = 'all_v1'
Or strip them:

Code: Select all

Convert(@FM,"",Activity.$CommandOutput) = 'all_v1'
And see if either one works for you.
-craig

"You can never have too many knives" -- Logan Nine Fingers
times29
Premium Member
Premium Member
Posts: 202
Joined: Mon Sep 22, 2008 3:47 pm

Post by times29 »

I tried both with single quote and double quote around all_v1
still not working
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Changing quotes won't make any difference.

There must be something here we are missing (or at least I am), some vital piece of information left unspoken. Can you expand on your job design, specifically what "using nested condition to load table_a" and "not getting loaded" mean? I've been making some assumptions, perhaps the issue is there. Log messages may help as well, like what you posted for 1).
-craig

"You can never have too many knives" -- Logan Nine Fingers
sathya_anjan
Participant
Posts: 20
Joined: Tue Feb 02, 2010 4:49 am
Location: United Kingdom

Post by sathya_anjan »

As per Craig it is the Field Marks which is causing your condition to fail. Strip the Field Marks in the Nested Condtion Stage using the below Derivation:

Convert(@FM,"", Activity.$CommandOutput ) = 'all_v1'

Let me know if this works.

Thanks

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

Post by ray.wurlod »

An alternative is to strip the line terminator in the command itself.

Code: Select all

grep string file | tr -d '\n'
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