View previous topic :: View next topic
|
Author |
Message |
crrindia
Active User
Joined: 02 Jul 2005 Posts: 124 Location: Gurgaon
|
|
|
|
Any one of you can please explain to me what is high values and low values in cobol (EBCDIC).
I heard that low values are 00, and high values are FF. But I wanted to know what will happen when I do the following operations?
Code: |
WORKING-STORAGE SECTION.
01 A PIC 9(2).
01 B PIC X(2).
01 C PIC 9(2).
01 D PIC X(2).
PROCEDURE DIVISION.
MOVE LOW-VALUES TO A.
MOVE LOW-VALUES TO B.
MOVE HIGH-VALUES TO C.
MOVE HIGH-VALUES TO D. |
After this what values are stored in A, B, C,and D? Can any one of you please explain to me. |
|
Back to top |
|
|
DavidatK
Active Member
Joined: 22 Nov 2005 Posts: 700 Location: Troy, Michigan USA
|
|
|
|
Hi,
First, You will not be able to Compile this.
You cannot move LOW-VALUES or HIGH-VALUES to a "PIC 9" field.
Once you remove these, the hex value in B and D are:
B = x'0000'
D = x'FFFF'
Dave |
|
Back to top |
|
|
crrindia
Active User
Joined: 02 Jul 2005 Posts: 124 Location: Gurgaon
|
|
|
|
Hi Dave, Thank you very much for your information.
Can you please let me know in which scenarios we will move these LOW/HIGH Values?
Thanks!
Rat. |
|
Back to top |
|
|
satish_r84
New User
Joined: 31 Jul 2006 Posts: 6
|
|
|
|
hi ,
What is the use of low or high values, when do we use it..
can you jus explain this with an example
Regards
satish |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Ex:
Low values: we generally used to initialize variable.
High value : Suppose i want to get minimum value of an array variable which have 10 occurance so i will write me code like this.
Move high values to min-value
perform until i>10
If table(i) < min-value
move table(i) to min-value
end-if
compute i = i+1
end-perform. |
|
Back to top |
|
|
shivaleela
New User
Joined: 27 Jul 2006 Posts: 3
|
|
|
|
Hi,
Is LOW VALUES used for the similar purpose as given in the above eg?
Anybody else know more specific examples of usage of LOW VALUES and HIGH VALUES
thx
shivu |
|
Back to top |
|
|
|