Extraction

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
India2000
Participant
Posts: 274
Joined: Sun Aug 22, 2010 11:07 am

Extraction

Post by India2000 »

I have a series of data coming in for different column fields.How shall I extract values for each field using seq file stage?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

No idea what that means. :?

Can you provide an example or three? Something to show us, make us understand what "a series of data coming in for different column fields" would mean? Thanks.
-craig

"You can never have too many knives" -- Logan Nine Fingers
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Or maybe you just need to read it as a fixed-width file. Can you post examples please of what you are looking at, before and after?
-craig

"You can never have too many knives" -- Logan Nine Fingers
India2000
Participant
Posts: 274
Joined: Sun Aug 22, 2010 11:07 am

Post by India2000 »

chulett wrote:Or maybe you just need to read it as a fixed-width file. Can you post examples please of what you are looking at, before and after?


etc,..
Last edited by India2000 on Fri Sep 24, 2010 8:12 am, edited 2 times in total.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Read it as fixed-width.
-craig

"You can never have too many knives" -- Logan Nine Fingers
India2000
Participant
Posts: 274
Joined: Sun Aug 22, 2010 11:07 am

Post by India2000 »

chulett wrote:Read it as fixed-width.
it has 20 fields.. if i read it as a fixed with file i get only 5 fields..
kris007
Charter Member
Charter Member
Posts: 1102
Joined: Tue Jan 24, 2006 5:38 pm
Location: Riverside, RI

Post by kris007 »

Not sure how you will end up with 5 fields if you read it as a fixed width file :?

If you know the layout of the file, it should work just fine.

Are you expecting blanks within your data where you intend to just add commas? You can read it as a single column and split them in a transformer stage as well if you want to.
Kris

Where's the "Any" key?-Homer Simpson
India2000
Participant
Posts: 274
Joined: Sun Aug 22, 2010 11:07 am

Post by India2000 »

kris007 wrote:Not sure how you will end up with 5 fields if you read it as a fixed width file :?

If you know the layout of the file, it should work just fine.

Are you expecting blanks within your data where you intend to just add commas? You can read it as a single column and split them in a transformer stage as well if you want to.
first field is like as I sent in the example..next are fields with tabs
anbu
Premium Member
Premium Member
Posts: 596
Joined: Sat Feb 18, 2006 2:25 am
Location: india

Post by anbu »

Read as tab delimited file. Then use substring function to split further
You are the creator of your destiny - Swami Vivekananda
arunkumarmm
Participant
Posts: 246
Joined: Mon Jun 30, 2008 3:22 am
Location: New York
Contact:

Post by arunkumarmm »

Do you know the exact length of the record? If so as suggested earlier you can read it in a single column. And if you are not sure about the record length and if you are sure you have a line terminator, you can define a column like varchar 999 and read it as a delimited file with '000' in the delimiter and the quote character and split it in a transformer
Arun
kris007
Charter Member
Charter Member
Posts: 1102
Joined: Tue Jan 24, 2006 5:38 pm
Location: Riverside, RI

Post by kris007 »

India2000 wrote: first field is like as I sent in the example..next are fields with tabs
Again, if you can provide an example for people to you help you correctly, you will get an answer fast.

As Craig had asked, provide a sample record for all the 20 fields that are coming in so that we can chip in with our suggestions. It's hard for us to come up with an answer that works for you when you provide bits and pieces of your actual case.
Kris

Where's the "Any" key?-Homer Simpson
India2000
Participant
Posts: 274
Joined: Sun Aug 22, 2010 11:07 am

Post by India2000 »

kris007 wrote:
India2000 wrote: first field is like as I sent in the example..next are fields with tabs
Again, if you can provide an example for people to you help you correctly, you will get an answer fast.

As Craig had asked, provide a sample record for all the 20 fields that are coming in so that we can chip in with our suggestions. It's hard for us to come up with an answer that works for you when you provide bits and pieces of your actual case.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Import the table definition. Specify fixed width. Specify column widths of 5,1,6 (or whatever is correct). Define "proper" column names. Use that table definition for the Format as well as the Columns tab. All will be well.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
asorrell
Posts: 1707
Joined: Fri Apr 04, 2003 2:00 pm
Location: Colleyville, Texas

Post by asorrell »

India2000 - You need to do what people ask you to do. You have been asked five times by different posters to give examples of your text if you want proper help. Stop wasting our time!
Andy Sorrell
Certified DataStage Consultant
IBM Analytics Champion 2009 - 2020
Post Reply