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
 

 

Meaning of low values and high values

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
sandeep kumar302

New User


Joined: 14 Mar 2012
Posts: 69
Location: India

PostPosted: Thu Dec 11, 2014 3:37 pm    Post subject: Meaning of low values and high values
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: 69
Location: India

PostPosted: Thu Dec 11, 2014 4:44 pm    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7231

PostPosted: Thu Dec 11, 2014 5:05 pm    Post subject: Reply to: Confusion on Low values and high values
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: 52
Location: Chennai

PostPosted: Thu Dec 11, 2014 5:19 pm    Post subject:
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: 7913
Location: Bellevue, IA

PostPosted: Thu Dec 11, 2014 5:31 pm    Post subject:
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: 69
Location: India

PostPosted: Thu Dec 11, 2014 6:55 pm    Post subject:
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: 1238
Location: Richfield, MN, USA

PostPosted: Thu Dec 11, 2014 8:28 pm    Post subject:
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: 645
Location: Pennsylvania

PostPosted: Thu Dec 11, 2014 8:41 pm    Post subject:
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: 69
Location: India

PostPosted: Fri Dec 12, 2014 9:35 am    Post subject:
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: 69
Location: India

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

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

Senior Member


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

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

Might interest: http://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: 645
Location: Pennsylvania

PostPosted: Fri Dec 12, 2014 6:03 pm    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7231

PostPosted: Fri Dec 12, 2014 6:55 pm    Post subject: Reply to: Confusion on Low values and high values
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    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 High CPU consumption Job using IAM fi... aswinir JCL & VSAM 8 Thu Dec 01, 2016 8:28 pm
No new posts Overlaying one set of charater values... Kevin Lindsley SYNCSORT 7 Sat Nov 05, 2016 3:21 am
No new posts Low values Results from VARCHAR FORMAT balaji81_k DB2 10 Thu Oct 20, 2016 1:18 am
No new posts How can we create a flat file in JAVA... rakesh.v18 Java & MQSeries 7 Fri Sep 23, 2016 10:46 pm
No new posts COBOL DB2 - CALL statement - high CPU... TS70363 DB2 15 Sun Sep 11, 2016 6:07 am


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