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
validation on fixed-length records
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 197
- Joined: Mon Feb 17, 2003 11:20 pm
- Location: India
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
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
-
- Participant
- Posts: 3593
- Joined: Thu Jan 23, 2003 5:25 pm
- Location: Australia, Melbourne
- Contact:
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.
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.
Certus Solutions
Blog: Tooling Around in the InfoSphere
Twitter: @vmcburney
LinkedIn:Vincent McBurney LinkedIn
Blog: Tooling Around in the InfoSphere
Twitter: @vmcburney
LinkedIn:Vincent McBurney LinkedIn
-
- Participant
- Posts: 197
- Joined: Mon Feb 17, 2003 11:20 pm
- Location: India