Page 1 of 1

change in number of columns

Posted: Mon Jul 25, 2005 8:36 am
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

Posted: Mon Jul 25, 2005 8:41 am
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?

Posted: Mon Jul 25, 2005 10:04 am
by Sainath.Srinivasan
Treat the full row as a single column.

Posted: Mon Jul 25, 2005 10:12 am
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

Posted: Mon Jul 25, 2005 10:45 am
by Sainath.Srinivasan
You can use complex flat file or strip the required record type to process.

Posted: Mon Jul 25, 2005 9:03 pm
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".

Posted: Tue Jul 26, 2005 3:56 am
by gopskrish
Hi Ray,

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

Thanks everyone for your support.

cheers,
gops