View previous topic :: View next topic
|
Author |
Message |
gekalpana
New User
Joined: 11 Apr 2007 Posts: 12 Location: Chennai
|
|
|
|
Please let me know, How the NULL Values are checked in the Cobol Program.
Example, the input file contains Null values in the " Last name " variable. How can i check, whether the variable has a Null value or not.
Example code: The below code is not Working.
IF WS-LST-NM = SPACES
MOVE 'Y' TO WS-ERROR-IND2
ELSE
IF WS-LST-NM = LOW-VALUES
MOVE 'T' TO WS-ERROR-IND2
END-IF
END-IF
Thanks !! |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
What does WS-LST-NM contain?
Add a DISPLAY and use HEX to view the sysout. |
|
Back to top |
|
|
srinivaskumarkota
New User
Joined: 23 Mar 2007 Posts: 1 Location: vijaz
|
|
|
|
IN COBOL THERE IS NO NULL VALUES CONCEPT AS PER MY KNOWLEDGE
WHAT IS THE VALUE WS-LST-NM?
It is a 'X' field,some times it will contain the junk value rather than SPACES
LOW-VALUES MEANS IT IS COMPLIER OPTION. IF FILE IS EMPTY THAT FILED IS NOT EQUAL TO LOW-VALUES.
THIS IS MY OPINION |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
I understand and agree with your answer until this...
srinivaskumarkota wrote: |
LOW-VALUES MEANS IT IS COMPLIER OPTION. IF FILE IS EMPTY THAT FILED IS NOT EQUAL TO LOW-VALUES. |
Huh? Could you explain a little? Compiler option? Empty file?
BTW, turn off the CAPS...... |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Kalpana,
Quote: |
How the NULL Values are checked in the Cobol Program |
I assume you are checking for valid data in the var WS-LST-NM (like alphabet or numbers).
If your requirement is this, use class condition to check for alphanumeric value. |
|
Back to top |
|
|
prasadvrk
Active User
Joined: 31 May 2006 Posts: 200 Location: Netherlands
|
|
|
|
If you are referring to NULL value from DB2 table, in that case you have check the null indicator for value -1 which means the field contains NULL. |
|
Back to top |
|
|
Mickeydusaor
Active User
Joined: 24 May 2006 Posts: 258 Location: Salem, Oregon
|
|
|
|
Yes in COBOL there is a NULL values.
SET WS-TABLE-POINTER TO NULLS
SET WS-TABLE-POINTER TO ENTRY WS-OPTS-TABLE
IF WS-TABLE-POINTER = NULLS |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Your problem data most likely contains something that is unreadable (will not display nicely) but is not low-values.
As was suggested earlier, you will want to look at the data in hex to see what actual values are in the data. An easy way to do this is to use tso/ispf and browse the dataset. Once the dataset is displayed, enter the HEX ON command. |
|
Back to top |
|
|
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 1042 Location: Richmond, Virginia
|
|
|
|
Sure enough, so why not complete the lesson? From the IBM website:
Quote: |
Sets the receiving field to contain the value of an invalid address. |
This usage of NULL is not, I think, what the op had in mind. He seems to have been looking for an analogue to the DB2 null, as someone has indicated above. |
|
Back to top |
|
|
|