# Meaning of low values and high values

Author Message
sandeep kumar302

New User

Joined: 14 Mar 2012
Posts: 81
Location: India

Posted: Thu Dec 11, 2014 3:37 pm

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?
sandeep kumar302

New User

Joined: 14 Mar 2012
Posts: 81
Location: India

Posted: Thu Dec 11, 2014 4:44 pm

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
Bill Woodger

Moderator Emeritus

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

 Posted: Thu Dec 11, 2014 5:05 pm 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?
Ramsee

New User

Joined: 06 Jan 2011
Posts: 53
Location: Chennai

Posted: Thu Dec 11, 2014 5:19 pm

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)

 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.
Robert Sample

Global Moderator

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

Posted: Thu Dec 11, 2014 5:31 pm

 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.
sandeep kumar302

New User

Joined: 14 Mar 2012
Posts: 81
Location: India

 Posted: Thu Dec 11, 2014 6:55 pm Robert, I agree with you . 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.
Terry Heinze

JCL Moderator

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

Posted: Thu Dec 11, 2014 8:28 pm

 sandeep kumar302 wrote: Robert, I agree with you . 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.
daveporcelan

Active Member

Joined: 01 Dec 2006
Posts: 747
Location: Pennsylvania

Posted: Thu Dec 11, 2014 8:41 pm

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?
sandeep kumar302

New User

Joined: 14 Mar 2012
Posts: 81
Location: India

Posted: Fri Dec 12, 2014 9:35 am

 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
sandeep kumar302

New User

Joined: 14 Mar 2012
Posts: 81
Location: India

 Posted: Fri Dec 12, 2014 10:24 am sorry for the Caps
Anuj Dhawan

Superior Member

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

 Posted: Fri Dec 12, 2014 12:48 pm
daveporcelan

Active Member

Joined: 01 Dec 2006
Posts: 747
Location: Pennsylvania

 Posted: Fri Dec 12, 2014 6:03 pm 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?
Bill Woodger

Moderator Emeritus

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

Posted: Fri Dec 12, 2014 6:55 pm

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.
 View Bookmarks All times are GMT + 6 Hours

 Topic Forum Replies Similar Topics a copybook getting improper values in... COBOL Programming 7 JDBC Driver -Default Values DB2 1 Not able to view the values of variab... CA Products 1 ADD/ SUB Values DFSORT/ICETOOL 7 position, start pos, length of column... SYNCSORT 14
Search our Forums: