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
 

 

LOW-Values and NULL values in Cobol

 
Post new topic   This topic is locked: you cannot edit posts or make replies.    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: LOW-Values and NULL values in Cobol
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: 3158
Location: Tucson AZ

PostPosted: Thu Jun 21, 2007 2:52 pm    Post subject: Re: LOW-Values and NULL values in Cobol
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    Post subject: Re: LOW-Values and NULL values in Cobol
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: 3158
Location: Tucson AZ

PostPosted: Thu Jun 21, 2007 4:02 pm    Post subject: Re: LOW-Values and NULL values in Cobol
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: 1439
Location: Bangalore,India

PostPosted: Thu Jun 21, 2007 4:03 pm    Post subject:
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    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Thu Jun 21, 2007 8:37 pm    Post subject:
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

Active Member


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

PostPosted: Thu Jun 21, 2007 8:43 pm    Post subject:
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.    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts XML Parse for COBOL 5.2 Bhanu Praveen COBOL Programming 1 Sat Jul 08, 2017 8:58 pm
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm
No new posts Search utility(3.14) using JCl and Cobol RKS3 COBOL Programming 12 Sat Jun 10, 2017 10:24 pm
No new posts COBOL DB2 program - zIIP eligible vasanthz COBOL Programming 7 Wed May 31, 2017 5:12 am
No new posts Sorting of hex values Saurabh_mi DFSORT/ICETOOL 11 Thu May 25, 2017 3:49 pm


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