Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

NULLIF statement in a load parm dataset

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: NULLIF statement in a load parm dataset
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: 6968
Location: porcelain throne

PostPosted: Fri Jun 13, 2008 1:01 pm    Post subject:
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    Post subject: Reply to: NULLIF statement in a load parm dataset
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    Post subject:
Reply with quote

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

Global Moderator


Joined: 14 Mar 2007
Posts: 10274
Location: italy

PostPosted: Fri Jun 13, 2008 4:51 pm    Post subject: Reply to: NULLIF statement in a load parm dataset
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    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts ON 2 AND EVERY 1 - Statement ??? UmeySan COBOL Programming 2 Tue Jul 25, 2017 1:20 pm
No new posts Browse dataset cvnlynn CLIST & REXX 4 Tue Jul 18, 2017 3:52 am
No new posts Db2 load job abending in SORT mistah kurtz DB2 4 Mon Jun 05, 2017 3:58 pm
No new posts Fileaid 2 commands instream work. In ... descann Compuware & Other Tools 2 Tue May 16, 2017 3:31 pm
No new posts To find out size allocated to a seque... ashek15 JCL & VSAM 15 Thu Apr 27, 2017 9:42 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us