Page 1 of 1

SequentialFile

Posted: Sat May 07, 2005 6:08 am
by naren6876
Hi,
How can i open a sequential file with the variable column lengths.

TIA

Posted: Sat May 07, 2005 6:10 am
by ray.wurlod
Are the columns delimited by some character? If so specify that information when importing the table definition, and use a Sequential File stage.

Otherwise, provided there's a small number of variations, the Complex Flat File stage may be more appropriate.

Posted: Sat May 07, 2005 6:26 am
by naren6876
I have a sequential file with the single column with the length of 250.So, In my seq_file stage i have mentioned a single column Col1 ----char(250),it works fine for me.
with the same job i have to open sequential file with single column and length of 100.
When i tried to do so ,i got error like unexpectedly ended by EOR.
How can i achieve this?

TIA
ray.wurlod wrote:Are the columns delimited by some character? If so specify that information when importing the table definition, and use a Sequential File stage.

Otherwise, provided there's a small number of variations, the Complex Flat File stage may be more appropriate.

Posted: Sat May 07, 2005 6:43 am
by dstechdev
As long as both files have the same row delimeter, try making the column width varchar(250). Should handle both 250 and 100

Posted: Sat May 07, 2005 5:44 pm
by ray.wurlod
Scroll to the right in the columns grid to find out where to handle incomplete records.

Specify the original read as VarChar(250). When you need the first 100 characters, use substring techniques - there's no need to re-read the file.