Hi All,
I am using sequential file as my source I just want to assign null values to ? .I just want to do this in the sequential file itself I dont want to handle this in the transformer by mentioning if isnull(column.name) then "?" else column.name.I have tried for null string in the sequential cloumn defintion but I didnt get it.Is there any possiblity.Please do help me.
Thanks in advance
replace null to string in a sequential file
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 26
- Joined: Thu Feb 03, 2005 1:05 am
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
There are no nulls in sequential files.
Therefore the Format tab in a Sequential File stage allows you to specify how null is represented. By default a zero length string is interpreted as null. In the Columns grid you can specify a different representation of null for each particular column. But this does NOT perform any conversion.
Conversion - in a server job - must be performed in a Transformer stage with an expression such asA separate transformation is required for each column.
If you're going to do a lot of these, create a Transform similar to the supplied null-handling Transforms such as NullToZero and NullToEmpty.
Therefore the Format tab in a Sequential File stage allows you to specify how null is represented. By default a zero length string is interpreted as null. In the Columns grid you can specify a different representation of null for each particular column. But this does NOT perform any conversion.
Conversion - in a server job - must be performed in a Transformer stage with an expression such as
Code: Select all
If IsNull(InLink.TheColumn) Then "?" Else InLink.TheColumn
If you're going to do a lot of these, create a Transform similar to the supplied null-handling Transforms such as NullToZero and NullToEmpty.
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: 26
- Joined: Thu Feb 03, 2005 1:05 am
-
- Premium Member
- Posts: 1044
- Joined: Wed Sep 29, 2004 3:30 am
- Location: Nottingham, UK
- Contact:
As Craig points out below, I misinterpreted Ray's answer, but here is a more full explanation of NULL strings in sequential files.dsquestion wrote:Hi Ray,
Thanks for your reply.Your reply was helpful.You are great.
If the input to a sequential file stage has a "Default NULL string:" value of ? in the Format tab, then @NULL will be written out as a ? character. Likewise if the output of the sequential file has ? as the null representation, then any field that has a value of ? or "?" will be interpreted as @NULL. No code is required in a transformer to do this.
You say that you have NULL values in a sequential file. As Ray points out, there are no NULLs in sequential files, only representations of null which by default is an empty string. What do your NULL source values look like?
Phil Hibbs.
Last edited by PhilHibbs on Tue Sep 20, 2005 7:57 am, edited 2 times in total.
Phil Hibbs | Capgemini
Technical Consultant
Technical Consultant