How to get data between ;'s

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
Cherukuri
Participant
Posts: 46
Joined: Wed Jul 25, 2007 2:43 am
Location: India
Contact:

How to get data between ;'s

Post by Cherukuri »

Hi,

I have a input source like :

Field1
-------
02102;9;988
4;8;8942333
09323;2;6700
874;34;2323

How can I get the data between ;'s the output file should be like:

Field1
--------
9
8
2
34

so the output file should contain the data between the ;'s of the input file.


Please tell me how to do this.


Thanks in Advance.
Cherukuri
Cheru
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Read the documentation for the Field() function, you can use it to get the 2nd field from your semi-colon delimited string.
-craig

"You can never have too many knives" -- Logan Nine Fingers
nani0907
Participant
Posts: 155
Joined: Wed Apr 18, 2007 10:30 am

Post by nani0907 »

Hi,

Use the feild function and take the postion of the field function to get the data.

Please let me know how it works.

Thanks
Sana.
thanks n regards
nani
Ramya_S
Participant
Posts: 1
Joined: Fri Oct 17, 2008 6:41 am
Location: Chennai

Post by Ramya_S »

Hi,

By using Field function--use derivation as specifed here "Field("Input column",";",2)"

Thanks,
Ramya
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

nani0907 wrote:Hi,

Use the feild function and take the postion of the field function to get the data.

Please let me know how it works.

Thanks
Sana.
Why don't you just read the manuals, the syntax of field function is
FIELD (string, delimiter, occurrence [ ,num.substr] )
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
dr.murthy
Participant
Posts: 224
Joined: Sun Dec 07, 2008 8:47 am
Location: delhi

Post by dr.murthy »

Hi,

just try with this Field(inputcolumn, ',' ,2).it works fine.
D.N .MURTHY
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

dr.murthy wrote:Hi,

just try with this Field(inputcolumn, ',' ,2).it works fine.
Not if the delimiter is ";".

:!: Attention to detail is SO important in this kind of work.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Kryt0n
Participant
Posts: 584
Joined: Wed Jun 22, 2005 7:28 pm

Post by Kryt0n »

dr.murthy wrote:Hi,

just try with this Field(inputcolumn, ',' ,2).it works fine.
Or alternatively just make the input field delimiter a ';' and then keep column 2...

(of course assuming there isn't further information delimited by something other than a ';')
Post Reply