validation on fixed-length records

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
qwert
Participant
Posts: 6
Joined: Tue Jul 27, 2004 10:29 am

validation on fixed-length records

Post by qwert »

Hi,


I have a problem with a fixed length file. I have to do a validation on the length of its records. The problem is that if a record is less than what it should be, the job is aborted. Is there a way to avoid this ?

Thanks
rasi
Participant
Posts: 464
Joined: Fri Oct 25, 2002 1:33 am
Location: Australia, Sydney

Post by rasi »

Explain more on the validation you are doing. In fixed width length record the size is always same. If you said 4 columns of fixed width type and each of length 100 then all the rows will have 400 characters length whether you have data or not. You have spaces if there is no data.

Thanks
Siva
sumitgulati
Participant
Posts: 197
Joined: Mon Feb 17, 2003 11:20 pm
Location: India

Post by sumitgulati »

One way is read the entire record in one column and validate the total length of the record. Then you can
1) Either use Substrings to break these one column records into multiple columns.
2) Or put the records with valid record length into another sequential file and then read this file as fixed length file.

Regards,
Sumit
vmcburney
Participant
Posts: 3593
Joined: Thu Jan 23, 2003 5:25 pm
Location: Australia, Melbourne
Contact:

Post by vmcburney »

There are two places on your sequential file stage to play around with when handling incomplete records. On the Outputs - Format tab you have options for missing columns for too few columns and "Suppress row truncation warnings" for too many columns. On the Outputs - Columns tab if you scroll to the right on your column grid you will see a title "Incomplete column" which may help you when you reach a column that is too short.

Between the two, missing columns and incomplete columns, you should be able to replace and pad out the record and then handle it in a transformer as a rejection or warning.

There is also a function for Unix, and someone will have to help us out here because I don't remember what it is called, that verifies that all records in a fixed width file are the same width. I believe it is shipped with DataStage.
sumitgulati
Participant
Posts: 197
Joined: Mon Feb 17, 2003 11:20 pm
Location: India

Post by sumitgulati »

Great Vincent. I could never before figure out what "incomplete columns" meant.

Regards,
Sumit
Post Reply