View previous topic :: View next topic
|
Author |
Message |
bibek24
New User
Joined: 14 Aug 2007 Posts: 35 Location: Hyderabad
|
|
|
|
Hi all,
Can anybody explain the following NULL IF statement in a load parm dataset used to laod a DB2 table:
FIELD1 POSITION (655) SMALLINT
NULLIF (35:36)=X'FFFF' ,
FIELD2 POSITION (657) SMALLINT
NULLIF (37:38)=X'FFFF' ,
FIELD3 POSITION (659) CHAR (1)
NULLIF (39:40)=X'FFFF' ,
What I know is this is being added to take care of the nullable fields in the table.
What is the significance of (35:36)? |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
have no idea, but will guess:
FIELD1 POSITION (655) SMALLINT
NULLIF (35:36)=X'FFFF' ,
At position 655 there is a value for a SMALLINT column FIELD1, but if position 35 and 36 contains x'FFFF' then the value is to be treated as NULL.
position 35 and 36 contains the NULL Indicator for FIELD1. |
|
Back to top |
|
|
bibek24
New User
Joined: 14 Aug 2007 Posts: 35 Location: Hyderabad
|
|
|
|
I have the requirement to make a field as null in a table wherever the value for the field in the load file is 0.
I mean the table has to be loaded through a load file.For a particular field ,wherever it is 0 in the file, I need to palce null for the same field in the table.
Any suggestions? |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
Is the column (field) defined as nullable? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
stop carrying on the same discussion in two threads ...
post which one You want to keep going and I' ll lock the other one |
|
Back to top |
|
|
bibek24
New User
Joined: 14 Aug 2007 Posts: 35 Location: Hyderabad
|
|
|
|
Finally I got it by coding
FIELD1 POSITION (655) SMALLINT
NULLIF (655)=X'0000' , |
|
Back to top |
|
|
bibek24
New User
Joined: 14 Aug 2007 Posts: 35 Location: Hyderabad
|
|
|
|
Code: |
CL_LAST_NAME POSITION (143) CHAR (25) ,
CL_MID_NAME POSITION (168) CHAR (1)
NULLIF (1:2)=X'FFFF' , |
|
|
Back to top |
|
|
|