Derivation

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
Cutty Mark
Participant
Posts: 8
Joined: Wed Sep 30, 2015 2:39 am

Derivation

Post by Cutty Mark »

Can someone help me with a derivation to be written in tfm stage to pass value '_' if any value exists in column A and value '/' if no value exists in column A.
:(
Never Quit
rkashyap
Premium Member
Premium Member
Posts: 532
Joined: Fri Dec 02, 2011 12:02 pm
Location: Richmond VA

Post by rkashyap »

Parallel or Server job?

Assuming parallel job, see examples of null handling functions in Parallel transformer in this link. Also see this post.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

:!: Let's assume Parallel and get your post into the correct forum. Starting off life in the FAQ Discussion forum wasn't it.

Cutty Mark, can you go back and edit your post to include the details the original forum didn't force you to include - O/S, Job Type, Version? Thanks.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

The transform stage for server and parallel jobs will have the same syntax for this column derivation

Code: Select all

IF (TRIM(InputLink.Column_A)='') THEN '/' ELSE '_'
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

... with just a little added complexity if your definition of "does not have a value" includes the possibility of NULL.

Code: Select all

If IsNull(InputLink.Column_A) Or (Trim(InputLink.Column_A) <= ' ') Then '/' Else '_'
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Cutty Mark
Participant
Posts: 8
Joined: Wed Sep 30, 2015 2:39 am

Reply

Post by Cutty Mark »

Thanku rkashyap. . . :)
I used IsNull() and solved it.
Its working fine
Never Quit
Cutty Mark
Participant
Posts: 8
Joined: Wed Sep 30, 2015 2:39 am

Post by Cutty Mark »

ray.wurlod wrote:... with just a little added complexity if your definition of "does not have a value" includes the possibility of NULL.
Yep. . . This is what I too tried. However, it was mentioned as 'If value doesn't exist in colomn(column_name)' . . .

So am not sure what they mean.

So waiting for the response from business side.

Thanku :)
Never Quit
Post Reply