cannot able to read the records of variable lenghts

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
syam
Participant
Posts: 10
Joined: Wed Nov 29, 2006 5:03 am

cannot able to read the records of variable lenghts

Post 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.
SHYAM
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

:!: Sample data would help
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

:idea: Rejected rows can be captured on a rejects link and re-parsed using a Column Import stage.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
bcarlson
Premium Member
Premium Member
Posts: 772
Joined: Fri Oct 01, 2004 3:06 pm
Location: Minnesota

Post 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.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Yes it does.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
vijayrc
Participant
Posts: 197
Joined: Sun Apr 02, 2006 10:31 am
Location: NJ

Post 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 ??
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Yes. Provided you've got metadata (typically a COBOL FD) that describes the redefinitions of a "record".
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply