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
 

 

Want to load null if a field is spaces

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
cvijay784
Warnings : 1

New User


Joined: 18 Jun 2008
Posts: 54
Location: Colombo

PostPosted: Mon Sep 05, 2011 5:30 pm    Post subject: Want to load null if a field is spaces
Reply with quote

HI,

I would like to load a field of 35 characters with null value when there is space.

Currently i have a statement given below.

Load Data Resume Yes..INTO Table1

(Field1 position (1:20) Char nullif(1:40 = x'4040404040404040404040404040404040404040'))

I just want to know if there is any simplified code instead of having long code like (x'4040404040404040404040404040404040404040').

Thanks
Vijay
Back to top
View user's profile Send private message

cvijay784
Warnings : 1

New User


Joined: 18 Jun 2008
Posts: 54
Location: Colombo

PostPosted: Mon Sep 05, 2011 6:57 pm    Post subject:
Reply with quote

DB2 utility throws syntax error when i continue that long hexadecimal value on 2nd line.

(Field1 position (1:40) Char
nullif(1:40 = '404040404040404040440404040404040-
4040404040404040404040'))

I tried hyphen also at 72nd byte as continuation character...but getting same syntax error.

Can anyone tell me how to resolve this issue?

Thanks
Vijay
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Sep 06, 2011 12:09 am    Post subject:
Reply with quote

Hello,

Using the Code tag, post the actual sql being run and the disgnostic information generated. Copy/paste - do not re-type.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


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

PostPosted: Tue Sep 06, 2011 5:09 am    Post subject:
Reply with quote

cvijay784 wrote:
DB2 utility throws syntax error when i continue that long hexadecimal value on 2nd line.

(Field1 position (1:40) Char
nullif(1:40 = '404040404040404040440404040404040-
4040404040404040404040'))

I tried hyphen also at 72nd byte as continuation character...but getting same syntax error.

Can anyone tell me how to resolve this issue?

Thanks
Vijay

Is the column defined as nullable?
Back to top
View user's profile Send private message
cvijay784
Warnings : 1

New User


Joined: 18 Jun 2008
Posts: 54
Location: Colombo

PostPosted: Tue Sep 06, 2011 4:45 pm    Post subject:
Reply with quote

Yes. Its a nullable field.
Back to top
View user's profile Send private message
cvijay784
Warnings : 1

New User


Joined: 18 Jun 2008
Posts: 54
Location: Colombo

PostPosted: Tue Sep 06, 2011 4:47 pm    Post subject:
Reply with quote

I used spaces directly as given below instead of hexadecimal value. Load was successfull. Thanks.


(Field1 position (1:40) Char
nullif(1:40 = ' '))
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 INVALID FIELD OR CONSTANT IN SORTOF ?? Ron Klop DFSORT/ICETOOL 8 Wed Jan 11, 2017 3:44 pm
No new posts Performing arithmetic on input field zh_lad DFSORT/ICETOOL 31 Tue Dec 06, 2016 8:04 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm


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