I have file whose 1st and last row is enter, NULL or space when I set sequential file stage formatting even nullfield to '' it's not inserting .
Let me know how i can read all records even empty one having space,enter or Null.
Formate as below
1.
2. 00001 T , N N MO 021698 DM UNFI
.
.
....
45050
Reading Sequential File including Null o Spaces
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
First, you need to realise that "", " " and NULL are not the same thing, and that NULL (whatever that is) never occurs in text files. The NUL byte ('\0') may appear as a string terminator.
So you need to be very sure what these "rogue" lines contain, and deal with them.
One way is to have a Rejects link from the Sequential File stage that reads them. That way any line from the file that does not satisfy the metadata definition that you are using will be passed (as a single raw string) to the Rejects link for you to process as you will.
Another technique is to read the file specifying a single column of type VarChar (or Long VarChar if you must), and cleanse and parse in a downstream Transformer stage. This gives the benefit that the parsing step is occurring in parallel (unless, for some reason, you choose to force the Transformer stage to execute in sequential mode).
So you need to be very sure what these "rogue" lines contain, and deal with them.
One way is to have a Rejects link from the Sequential File stage that reads them. That way any line from the file that does not satisfy the metadata definition that you are using will be passed (as a single raw string) to the Rejects link for you to process as you will.
Another technique is to read the file specifying a single column of type VarChar (or Long VarChar if you must), and cleanse and parse in a downstream Transformer stage. This gives the benefit that the parsing step is occurring in parallel (unless, for some reason, you choose to force the Transformer stage to execute in sequential mode).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Do you have a reject link to capture your empty rows (since they do not match the metadata)? Are there warnings in the job log reporting that import failed for two rows?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
See Also: viewtopic.php?t=153723
Choose a job you love, and you will never have to work a day in your life. - Confucius