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

Meaning of low values and high values


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sandeep kumar302

New User


Joined: 14 Mar 2012
Posts: 81
Location: India

PostPosted: Thu Dec 11, 2014 3:37 pm
Reply with quote

Hi,
Can someone explain me the meaning of this low values and high values in the below code-

Code:

IF L100-FLAG EQUAL LOW-VALUES
    MOVE TNOMINEE     TO W040-N-NOMINEE
    SET  W032-NE-OK                TO TRUE


i read somewhere that low values and high values are boundary values and any value will be within this boundary.

Then what exactly does the above code suggest?
Back to top
View user's profile Send private message
sandeep kumar302

New User


Joined: 14 Mar 2012
Posts: 81
Location: India

PostPosted: Thu Dec 11, 2014 4:44 pm
Reply with quote

If i am not wrong, here low values will be spaces and if it is true then why can't we simply write -
Code:

IF L100-FLAG EQUAL SPACES
    MOVE TNOMINEE     TO W040-N-NOMINEE
    SET  W032-NE-OK                TO TRUE
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Dec 11, 2014 5:05 pm
Reply with quote

LOW-VALUES are the lowest value in the collating sequence for your program. HIGH-VALUES are the highest.

Unless you are mucking about with the collating sequence, LOW-VALUE will be binary zero (X'00' assuming a one-byte field) and HIGH-VALUE will be X'FF'.

So, no, you can't change it to SPACE which is X'40'.

Since it is a "flag" it will be much better to use an 88 for the test. Why use 88s then introduce confusion by tests/MOVEs of literal values for other flags? Just test an 88 and SET the values.

L100 is in the LINKAGE SECTION, or the L means something else? Can you show that field?
Back to top
View user's profile Send private message
Ramsee

New User


Joined: 06 Jan 2011
Posts: 53
Location: Chennai

PostPosted: Thu Dec 11, 2014 5:19 pm
Reply with quote

Hi Sandeep,
HIGH-VALUES and LOW-VALUES are figurative constants,depending on the COLLATING SEQUENCE(a logical order for the characters ordered sequence of the program).

LOW-VALUES is defined as lowest position of the program collating sequence, HIGH-VALUES is defined as the highest position of the collating sequence.

If the Collating sequence is EBCDIC,
LOW-VALUES has the value of X'00' (an 8-BIT character code of all Binary 0's) and HIGH-VALUES has X'FF' (an 8-bit character code fo all binary 1's)

If the Collating sequence is ASCII,
LOW-VALUES has the value of X'00' (an 7-BIT character code of all Binary 0's) and HIGH-VALUES has X'7F' (an 7-bit character code fo all binary 1's)

Here in your case,
Quote:

If i am not wrong, here low values will be spaces and if it is true then why can't we simply write -
Code:

IF L100-FLAG EQUAL SPACES
MOVE TNOMINEE TO W040-N-NOMINEE
SET W032-NE-OK TO TRUE



LOW-VALUES are not always equal to spaces as the value for SPACES is '04'/'08'. pls verfiy by using "HEX ON"

Kindly guide me if my understanding is wrong.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Dec 11, 2014 5:31 pm
Reply with quote

Quote:
LOW-VALUES are not always equal to spaces as the value for SPACES is '04'/'08'. pls verfiy by using "HEX ON"

Kindly guide me if my understanding is wrong.
Actually, you are wrong. LOW-VALUES will NEVER be equal to SPACE -- a space is X'40' in EBCDIC or X'20' in ASCII whereas LOW-VALUE will be X'00' for both. And what is "'04'/'08'"? A space is neither of these values according to any collating sequence in common usage.
Back to top
View user's profile Send private message
sandeep kumar302

New User


Joined: 14 Mar 2012
Posts: 81
Location: India

PostPosted: Thu Dec 11, 2014 6:55 pm
Reply with quote

Robert,
I agree with you icon_biggrin.gif .

But i am still liooking for an exact answer. I am also trying from me end.
Please let me know if you have detailed explanation with example.
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Thu Dec 11, 2014 8:28 pm
Reply with quote

sandeep kumar302 wrote:
Robert,
I agree with you icon_biggrin.gif .

But i am still liooking for an exact answer. I am also trying from me end.
Please let me know if you have detailed explanation with example.

For an exact answer you need to post the picture and usage clauses of all 4 data fields referenced in the code you posted.
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Thu Dec 11, 2014 8:41 pm
Reply with quote

If you agree with Robert, then you have the exact answer:

Quote:
LOW-VALUES will NEVER be equal to SPACE


What is the value of L100-FLAG, and where is it populated?
Is this done in your program, or is it passed in thru the Linkage section as Bill suggested above?
Back to top
View user's profile Send private message
sandeep kumar302

New User


Joined: 14 Mar 2012
Posts: 81
Location: India

PostPosted: Fri Dec 12, 2014 9:35 am
Reply with quote

Code:
05  L100-FLAG                         PIC X(01).
    88  L100-FLAG-OK                  VALUE  "Y" "N".
    88  L100-N                        VALUE  "Y".
    88  L100-DRP-NOT-N                VALUE "N".

03  TNOMINEE     PIC X(01).
    88  TNOMINEE-OK         VALUE "Y", "N".
    88  TNOMINEE            VALUE "Y".
    88  TNOTNOMINEE         VALUE "N".


-HERE TNOMINEE IS COLUMN DEFINITION FOR TABLE 'NOMINEE' AND ITS VALUE WILL BE RETREIVED FROM TABLE


Code:
05 W040-N-NOMINEE          PIC X(01).
   88 W040-N-IS-NOMINEE       VALUE 'Y'
   88 W040-N-IS-NOT-NOMINEE   VALUE 'N'


The value of L100-FLAG is passed through linkage

Code'd and de-mangled
Back to top
View user's profile Send private message
sandeep kumar302

New User


Joined: 14 Mar 2012
Posts: 81
Location: India

PostPosted: Fri Dec 12, 2014 10:24 am
Reply with quote

sorry for the Caps
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Fri Dec 12, 2014 12:48 pm
Reply with quote

Might interest: www.ibmmainframes.com/viewtopic.php?t=33475&highlight=lowvalues
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Fri Dec 12, 2014 6:03 pm
Reply with quote

Sandeep,

Sorry I was not clear enough

What is the value of L100-FLAG at execution time?

You will need a display in your program , or use a debug tool.

This will tell you what you need to know.

The 88 levels you have are interesting however.
Are you expecting only Y or N?

Why don't you know what possible values are passed through Linkage?
Do you have access to the calling Program or Programmer?
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Dec 12, 2014 6:55 pm
Reply with quote

It is possible for LOW-VALUES to be space. LOW-VALUES is just the first value in the collation used in the program. If you make that value SPACE, then LOW-VALUES would be spaces.

The chance of seeing this in a Production program is nil, to 37 decimal places. Probably.

The names of your 88s vs the values represented are confusing.
Code:

IF L100-FLAG EQUAL LOW-VALUES
    MOVE TNOMINEE     TO W040-N-NOMINEE
    SET  W032-NE-OK                TO TRUE


This looks like code which says "if one particular flag that we would otherwise use has not had a value established for it, use this flag instead".

However, there's a lot of guessing in there without being able to see how W032, W040 and TNOMINEE and L100 are used.

Rather that the test for EQUAL LOW-VALUES, that is better as a well-named 88.

We've not see W032 at all.

It may assist you to find the spec for the program. The code hints at a bit of a twisted mess.
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
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 ISRSUPC search utility - using high l... TSO/ISPF 2
No new posts Converting ASCII values to COMP-3 (ZD... JCL & VSAM 2
Search our Forums:

Back to Top