Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 6970
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: 10457
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 Duplicate PARM on OUTFIL sancraig16 SYNCSORT 11 Thu Apr 05, 2018 10:25 pm
No new posts How could i share my personal dataset... James Halley TSO/ISPF 1 Fri Mar 23, 2018 9:41 pm
This topic is locked: you cannot edit posts or make replies. How could i share my personal dataset... samenxia163 TSO/ISPF 1 Fri Mar 09, 2018 12:18 pm
No new posts can we hardcode a value in db2 load c... ram_vizag DB2 2 Wed Feb 28, 2018 11:04 pm
No new posts load and delete table through JCL wit... ram_vizag JCL & VSAM 9 Thu Feb 01, 2018 12:47 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us