IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Field with NOT NULL


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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

Moderator Emeritus


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

PostPosted: Thu Aug 07, 2008 1:21 am
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
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
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

Moderator Emeritus


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

PostPosted: Thu Aug 07, 2008 2:16 am
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
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
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

Moderator Emeritus


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

PostPosted: Thu Aug 07, 2008 3:15 am
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
Reply with quote

Thank you all
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Thu Aug 07, 2008 11:56 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Null values are considered in Total c... DFSORT/ICETOOL 6
No new posts Join 2 files according to one key field. JCL & VSAM 3
No new posts How to move the first field of each r... DFSORT/ICETOOL 5
No new posts S0C7 - Field getting overlayed COBOL Programming 2
Search our Forums:

Back to Top