Page 1 of 1

cannot able to read the records of variable lenghts

Posted: Mon Jan 29, 2007 1:04 am
by syam
Hi all;
I am trying to read the source file in which some records are having the record length of 126 and some records are having record length of 114. i am able to read the data of length 126 only. but i want both 126&114 field length data to be read. one column in the source file has 26 length.but some records are coming as 26 and some rcords are coming 14.how i can read this file.

Thanks in advance;
Shyam.

Posted: Mon Jan 29, 2007 2:24 am
by ArndW
What source are you reading from? A sequential file?
It sounds as if you have declared the fields to be fixed length but they are of variable lengths so you would need to change your file metadata. Does this file have column delimiters? If it does then the change to a varying length column should be a simple matter. If it doesn't have delimiters then you may be better served using something like CFF or even your own "parsing" within DataStage. This depends upon how your source is actually set up and it would be best if you could post an example or additional description of your layout.

Posted: Mon Jan 29, 2007 8:11 am
by DSguru2B
:!: Sample data would help

Posted: Mon Jan 29, 2007 3:21 pm
by ray.wurlod
:idea: Rejected rows can be captured on a rejects link and re-parsed using a Column Import stage.

Posted: Tue Jan 30, 2007 3:38 pm
by bcarlson
Do you have 2 different record layouts in your input file? If so, then the Complex Flat File stage may be your best bet. I believe it allows you to define multiple record layouts.

I'll let someone who has actually used this stage pipe in here, just in case I got it wrong... (we need to do this ourselves, just have not had time to play around with it).

Brad.

Posted: Tue Jan 30, 2007 3:43 pm
by ray.wurlod
Yes it does.

Posted: Wed Jan 31, 2007 6:41 pm
by vijayrc
ray.wurlod wrote:Yes it does. ...
Ray, if a file has records with different layout, can this file be processed using a CFF ??

Posted: Wed Jan 31, 2007 11:00 pm
by ray.wurlod
Yes. Provided you've got metadata (typically a COBOL FD) that describes the redefinitions of a "record".