IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

NULLIF statement in a load parm dataset


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
bibek24

New User


Joined: 14 Aug 2007
Posts: 35
Location: Hyderabad

PostPosted: Fri Jun 13, 2008 12:36 pm
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Jun 13, 2008 1:01 pm
Reply with quote

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
View user's profile Send private message
bibek24

New User


Joined: 14 Aug 2007
Posts: 35
Location: Hyderabad

PostPosted: Fri Jun 13, 2008 4:15 pm
Reply with quote

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
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Fri Jun 13, 2008 4:46 pm
Reply with quote

Is the column (field) defined as nullable?
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Jun 13, 2008 4:51 pm
Reply with quote

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
View user's profile Send private message
bibek24

New User


Joined: 14 Aug 2007
Posts: 35
Location: Hyderabad

PostPosted: Fri Jun 13, 2008 5:09 pm
Reply with quote

Finally I got it by coding

FIELD1 POSITION (655) SMALLINT
NULLIF (655)=X'0000' ,
Back to top
View user's profile Send private message
bibek24

New User


Joined: 14 Aug 2007
Posts: 35
Location: Hyderabad

PostPosted: Wed Jul 02, 2008 12:50 pm
Reply with quote

Code:

CL_LAST_NAME POSITION (143) CHAR  (25) ,
CL_MID_NAME POSITION (168) CHAR  (1)   
NULLIF (1:2)=X'FFFF' ,                 
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Load new table with Old unload - DB2 DB2 6
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts How to load to DB2 with column level ... DB2 6
No new posts REASON 00D70014 in load utility DB2 6
Search our Forums:

Back to Top