parsing the data

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
nani1974
Premium Member
Premium Member
Posts: 52
Joined: Fri Aug 31, 2007 10:59 am

parsing the data

Post by nani1974 »

Hi,
I am trying to parse the data from a file,i has single record and i need to parse it into multiple fields,i dont have any length mentioned in the requirement,i need to parse the data based on particular word
ex: AID~BPCL LOCL~BAECN COVD~BEX *~ALST~BNLST TEST1 BCKL I20070703 1-608 W 176, MANHATTAN, NY ~ADIR~/CLS 22,SWXX,325911,,
this is the record and i need to split into fileds
AID(AID~BPCL LOCL~BAECN COVD~BEX)
ALST(*~ALST~BNLST TEST1 BCKL I20070703 1-608 W 176, MANHATTAN, NY)
i am using index function to split the data,i am getting first field right but when i am doing second field its not showing properly,,,and my index is like this
read_data.Data [1,(index(read_data.Data,"ALST",1)-1)](extracting first field)
read_data.Data [index(read_data.Data,"ALST",1),(index(read_data.Data,"ADIR",1)-1)]

thanks
naveen
anbu
Premium Member
Premium Member
Posts: 596
Joined: Sat Feb 18, 2006 2:25 am
Location: india

Post by anbu »

Second field in substring should be length

Code: Select all

read_data.Data [index(read_data.Data,"ALST",1),(index(read_data.Data,"ADIR",1)-1-index(read_data.Data,"ALST",1))]
You are the creator of your destiny - Swami Vivekananda
nani1974
Premium Member
Premium Member
Posts: 52
Joined: Fri Aug 31, 2007 10:59 am

Thank you

Post by nani1974 »

Its working now,

Thank you very much for ur help.

Naveen
Post Reply