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: 6966
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: 10231
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 Unable to catalog a gdg dataset resid... Shovan JCL & VSAM 7 Fri Mar 24, 2017 2:24 pm
No new posts Want to pull the job log into a Mainf... Jishu Mukherjee Compuware & Other Tools 9 Tue Mar 21, 2017 4:48 pm
No new posts JCL to get submitted once dataset has... vinu78 JCL & VSAM 17 Thu Feb 16, 2017 7:32 am
No new posts ROUNDED Problem with COMPUTE statement shalem COBOL Programming 11 Thu Feb 09, 2017 8:16 pm
No new posts VALIDATE NULL VALUE IN DB2 CASE STATE... useit DB2 5 Thu Feb 09, 2017 4:34 pm


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