change in number of columns

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
gopskrish
Participant
Posts: 37
Joined: Thu Mar 31, 2005 7:42 am

change in number of columns

Post by gopskrish »

Hi,

I am storing the source data in a sequential file without column headers.
I am having different records like F1,F2 etc.,
I am having different number columns for each. For example F1 has 100 columns, F2 as 200 etc.,

When i specify less columns in the file definition , I can able to view less records and vice versa (when i specify more columns also i can see less number of records). How can I control all records ? Throw me some light on that.

cheers,
gop
I am verymuch interested to learn an ETL tool and i find datastage as the best one to do so.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Gop,

this is not a "frequently asked question" and doesn't belong in this forum.

DataStage uses the end-of-record delimiter on delimited (non-fixed-length) files to switch to the next record, so the number of columns isn't necessary to get record data. You can specify in datastage what to do for each column if there is no data to read (when you have defined more columns in your job than actually exist in the data) plus you can have DataStage ignore extra data that is found after your last column declared in your job (when you have less columns in the job than are found in the data).

These are the two scenarios. What are you trying to do, or what exactly are you asking that DataStage does?
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Treat the full row as a single column.
gopskrish
Participant
Posts: 37
Joined: Thu Mar 31, 2005 7:42 am

Post by gopskrish »

Hi Andw and Sai,

Thanks a lot for your immediate feedback.

I have incorporated the same using single column. But my requirement is i need to change few column values based on some condition which is very difficult to implement if i use a single column. Is there any technique by which i can handle the same.

Thanks in Advance,
gops
I am verymuch interested to learn an ETL tool and i find datastage as the best one to do so.
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

You can use complex flat file or strip the required record type to process.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You can define more than enough columns for any row, with generic names (Field001 through Field200 for example), and set the missing and incomplete columns rules in the Columns grid to a rule such as "Replace".
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
gopskrish
Participant
Posts: 37
Joined: Thu Mar 31, 2005 7:42 am

Post by gopskrish »

Hi Ray,

Thanks a lot for your valuable input. It works fine.

Thanks everyone for your support.

cheers,
gops
I am verymuch interested to learn an ETL tool and i find datastage as the best one to do so.
Post Reply