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
 

 

Field with NOT NULL

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

Active User


Joined: 27 May 2008
Posts: 121
Location: India

PostPosted: Thu Aug 07, 2008 1:18 am    Post subject: Field with NOT NULL
Reply with quote

Hi,

Are spaces allowed in a column which is NOT NULL?

If a table is getting a feed from a file, and a column in the table is NOT NUL but it's repective value in File is blank then what would be the case ?


Thanks.
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: Thu Aug 07, 2008 1:21 am    Post subject:
Reply with quote

Hello,

By definition a blank value is not a null value.

When blanks arrive, they will be treated like any other data unless the code does something specific for blanks. There is nothing null about them.
Back to top
View user's profile Send private message
meenakshi_forum
Warnings : 1

Active User


Joined: 27 May 2008
Posts: 121
Location: India

PostPosted: Thu Aug 07, 2008 2:01 am    Post subject:
Reply with quote

Thank you.

1. So can we say spaces as blank ?

2. For a value as spaces(blank in a file) after some processing done on the file i am getting '.' as the value there .

There was no coding done to insert '.' there, any idea why it happens?

This field has 'N' or 'Y' as the eligible values.

3. If there are some fixed values for a field, say 'N' , 'Y', so can it get spaces at any instance?
Back to top
View user's profile Send private message
Suresh Ponnusamy

Active User


Joined: 22 Feb 2008
Posts: 107
Location: New York

PostPosted: Thu Aug 07, 2008 2:15 am    Post subject:
Reply with quote

Hi

1) We cannot directly say always SPACES are Blank. We have to refer the HEX value to determine the value. If the Hex Value is X'40' then it contains SPACES. If it is X'00' then it contains LOW-VALUES.
2) Please check the hex value and determine that. If it is X'00' then using INSPECT statement you can convert that to SPACES.
3) Please validate your program. There might be something in your program
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: Thu Aug 07, 2008 2:16 am    Post subject:
Reply with quote

Hello,

1. Yes spaces are blanks (they are hex'40').

2. You probably have some unprintable character rather than a blank.
If you browse the data in tso/ispf and use HEX ON, you can see
the actual hex value in the data.

3. I don't understand what this is asking. The "data" does not know that
there are fixed values. Your code may expect Y or N, but that does
not prevent other values (i.e. space) from being in the field. Whatever
creates the file must ensure that only valid values are in the data.
Back to top
View user's profile Send private message
meenakshi_forum
Warnings : 1

Active User


Joined: 27 May 2008
Posts: 121
Location: India

PostPosted: Thu Aug 07, 2008 2:33 am    Post subject:
Reply with quote

Thanks all,

I understand that space may come up and it can be valid but how about

'.' coming up ?
Back to top
View user's profile Send private message
meenakshi_forum
Warnings : 1

Active User


Joined: 27 May 2008
Posts: 121
Location: India

PostPosted: Thu Aug 07, 2008 2:38 am    Post subject: Reply to: Field with NOT NULL
Reply with quote

In TSO/ISPF--

For a number 001000750757P536 , it's corresponding values against it are as seen below

********************************
Code:
001000750757P536         .   

*****************************

i did hex on for this number and i got--


Code:
001000750757P536         .   
FFFFFFFFFFFFDFFF4444444440   
00100075075775360000000000   


Please tell me are those spaces before '.' ?
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: Thu Aug 07, 2008 3:15 am    Post subject:
Reply with quote

Hello,

Yes, there are 9 spaces (x'40') after the 6. The last byte contains x'00'.

Please note that your post has been edited using the "Code" tag (near the top of the Reply panel). This will preserve alignment and make your post much more readable.

When you are entering a post, you can use the Preview to see how your post will appear to the forum rathe rthan how it appears n the Reply editor. When you are satisfied with how your post appears, then click Submit.

As far as where the x'00' comes from, you would need to look into how the file is created.
Back to top
View user's profile Send private message
meenakshi_forum
Warnings : 1

Active User


Joined: 27 May 2008
Posts: 121
Location: India

PostPosted: Thu Aug 07, 2008 11:30 pm    Post subject:
Reply with quote

Thank you all
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: Thu Aug 07, 2008 11:56 pm    Post subject: Reply to: Field with NOT NULL
Reply with quote

You're welcome icon_smile.gif

d
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 SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts outrec field outside range Danielle.Filteau SYNCSORT 10 Sat Mar 04, 2017 2:37 am
No new posts VALIDATE NULL VALUE IN DB2 CASE STATE... useit DB2 5 Thu Feb 09, 2017 4:34 pm
No new posts 2 byte YEAR from Y'DATE2' field tecnokrat DFSORT/ICETOOL 2 Tue Feb 07, 2017 12:05 pm


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