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

LOW-Values and NULL values in Cobol


IBM Mainframe Forums -> COBOL Programming
Post new topic   This topic is locked: you cannot edit posts or make replies.
View previous topic :: View next topic  
Author Message
gekalpana

New User


Joined: 11 Apr 2007
Posts: 12
Location: Chennai

PostPosted: Thu Jun 21, 2007 2:46 pm
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Thu Jun 21, 2007 2:52 pm
Reply with quote

What does WS-LST-NM contain?
Add a DISPLAY and use HEX to view the sysout.
Back to top
View user's profile Send private message
srinivaskumarkota

New User


Joined: 23 Mar 2007
Posts: 1
Location: vijaz

PostPosted: Thu Jun 21, 2007 3:11 pm
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Thu Jun 21, 2007 4:02 pm
Reply with quote

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
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Thu Jun 21, 2007 4:03 pm
Reply with quote

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
View user's profile Send private message
prasadvrk

Active User


Joined: 31 May 2006
Posts: 200
Location: Netherlands

PostPosted: Thu Jun 21, 2007 5:00 pm
Reply with quote

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
View user's profile Send private message
Mickeydusaor

Active User


Joined: 24 May 2006
Posts: 258
Location: Salem, Oregon

PostPosted: Thu Jun 21, 2007 7:47 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Thu Jun 21, 2007 8:37 pm
Reply with quote

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
View user's profile Send private message
Phrzby Phil

Senior Member


Joined: 31 Oct 2006
Posts: 1042
Location: Richmond, Virginia

PostPosted: Thu Jun 21, 2007 8:43 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies. View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
Search our Forums:

Back to Top