View previous topic :: View next topic
|
Author |
Message |
sandeep kumar302
New User
Joined: 14 Mar 2012 Posts: 81 Location: India
|
|
|
|
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 |
|
|
sandeep kumar302
New User
Joined: 14 Mar 2012 Posts: 81 Location: India
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Ramsee
New User
Joined: 06 Jan 2011 Posts: 53 Location: Chennai
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
sandeep kumar302
New User
Joined: 14 Mar 2012 Posts: 81 Location: India
|
|
|
|
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. |
|
Back to top |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1248 Location: Richfield, MN, USA
|
|
|
|
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. |
|
Back to top |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
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 |
|
|
sandeep kumar302
New User
Joined: 14 Mar 2012 Posts: 81 Location: India
|
|
|
|
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 |
|
|
sandeep kumar302
New User
Joined: 14 Mar 2012 Posts: 81 Location: India
|
|
|
|
sorry for the Caps |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
Back to top |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
|