Reg:How to use field function

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
pradeep_nov18
Participant
Posts: 92
Joined: Wed Mar 05, 2008 4:09 am
Location: chennai
Contact:

Reg:How to use field function

Post by pradeep_nov18 »

Hi all,

I have requirement,Please help me how to Achieve these

Input Output
AD-ADE-0000000001 0000000001
AF-ADF-0000000002 0000000002

Thanks for your help in Advance.
pradeep.v
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You really should wrap fixed-format text in Code tags.

Code: Select all

Input              Output 
AD-ADE-0000000001 0000000001 
AF-ADF-0000000002 0000000002 
The delimiter in these delimited strings is "-", and that becomes the second argument to the Field() function. The delimited string that you want to extract is the third, so 3 is the third argument of the Field() function. You only want to extract one substring, so 1 is the fourth argument to the Field() function. From this we get:

Code: Select all

Field(InLink.Input, "-", 3, 1)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Let me give you the short version - 3rd field from a dash delimited string. Walla! :D

(yes, I know that is not how it is spelled)
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply