View previous topic :: View next topic
|
Author |
Message |
meenakshi_forum Warnings : 1 Active User
Joined: 27 May 2008 Posts: 121 Location: India
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
meenakshi_forum Warnings : 1 Active User
Joined: 27 May 2008 Posts: 121 Location: India
|
|
|
|
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 |
|
|
Suresh Ponnusamy
Active User
Joined: 22 Feb 2008 Posts: 107 Location: New York
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
meenakshi_forum Warnings : 1 Active User
Joined: 27 May 2008 Posts: 121 Location: India
|
|
|
|
Thanks all,
I understand that space may come up and it can be valid but how about
'.' coming up ? |
|
Back to top |
|
|
meenakshi_forum Warnings : 1 Active User
Joined: 27 May 2008 Posts: 121 Location: India
|
|
|
|
In TSO/ISPF--
For a number 001000750757P536 , it's corresponding values against it are as seen below
********************************
*****************************
i did hex on for this number and i got--
Code: |
001000750757P536 .
FFFFFFFFFFFFDFFF4444444440
00100075075775360000000000 |
Please tell me are those spaces before '.' ? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
meenakshi_forum Warnings : 1 Active User
Joined: 27 May 2008 Posts: 121 Location: India
|
|
|
|
Thank you all |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
You're welcome
d |
|
Back to top |
|
|
|