View previous topic :: View next topic
|
Author |
Message |
vishal_a
New User
Joined: 24 May 2005 Posts: 45 Location: Noida
|
|
|
|
PLEASE HELP
WHAT IS MEANT BY MOVE HIGH-VALUES OR MOVE LOW-VALUES
REGARDS
VISHAL |
|
Back to top |
|
|
jhony
New User
Joined: 24 Jun 2005 Posts: 2 Location: pune
|
|
|
|
hi friend,
Moving high values to low values, In case of cobol program when you move high values into low values truncation happens in the resulted value.
When you move an alpha numeric value its justification is left justification and right truncation.If you use numeric values ,the justification is right and the truncation happens on left side and padding also happens on left side..
I think its the suitable answer for this type of que...
and at the same time refer your que...once...
bye. |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Hi VISHAL,
It really depends upon the computing environment and its vendor. But for IBM mainframes MOVE LOW-VALUES moves binary zeros (X'00') to the bytes in the target field; MOVE HIGH-VALUES moves the highest byte value possible (X'FF') to the bytes in the target field. |
|
Back to top |
|
|
sonalig
New User
Joined: 22 Aug 2005 Posts: 7 Location: India
|
|
|
|
Hi,
LOW-VALUES and HIGH-VALUES are figurative constants that represent the lowest and highest possible values for an alphanumeric data item. You would use them anytime you want to set or compare a data item to "all bits off" or "all bits on" values.
On system 390, LOW-VALUE = X'00' and HIGH-VALUE = X'FF'.
Correct me if i'm wrong.
Thanks,
Sonali. |
|
Back to top |
|
|
sendil
New User
Joined: 30 Jun 2005 Posts: 27
|
|
|
|
HIGH-VALUE/HIGH-VALUES
Represents one or more occurrences of the character that has the
highest ordinal position in the collating sequence used. For the
EBCDIC collating sequence, the character is X'FF'; for other collating
sequences, the actual character used depends on the collating sequence
used. HIGH-VALUE is treated as an alphanumeric literal.
LOW-VALUE/LOW-VALUES
Represents one or more occurrences of the character that has the
lowest ordinal position in the collating sequence used. For the
EBCDIC collating sequence, the character is X'00'; for other collating
sequences, the actual character used depends on the collating sequence
used. LOW-VALUE is treated as an alphanumeric literal. |
|
Back to top |
|
|
harinatha
New User
Joined: 24 Jul 2005 Posts: 28
|
|
|
|
Hi,
Can any one explain with examples..
Take below one or give your own example....
1)
01 WS-NUM PIC 9(4)
MOVE HIGH-VALUES TO WS-NUM
Now what will be the value of WS-NUM
MOVE LOW-VALUES TO WS-NUM
Now what will be the value of WS-NUM
2)
01 WS-VAR PIC X(4)
MOVE HIGH-VALUES TO WS-VAR
Now what will be the value of WS-VAR
MOVE LOW-VALUES TO WS-VAR
Now what will be the value of WS-VAR.
Thanks & Regards,
Hari. |
|
Back to top |
|
|
jhony
New User
Joined: 24 Jun 2005 Posts: 2 Location: pune
|
|
|
|
1)
01 WS-NUM PIC 9(4)
MOVE HIGH-VALUES TO WS-NUM
Now what will be the value of WS-NUM
MOVE LOW-VALUES TO WS-NUM
.
---->ws-num = 0000.
2)
01 WS-VAR PIC X(4)
MOVE HIGH-VALUES TO WS-VAR
Now what will be the value of WS-VAR
MOVE LOW-VALUES TO WS-VAR
------>ws-num = 0000.
As far my knowledge these are the correct answers....if you doubt refer once the cobol comlete ref... by M.k.Roy...
bye.. |
|
Back to top |
|
|
priyesh.agrawal
Senior Member
Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
|
|
Hi jhony,
Quote: |
01 WS-NUM PIC 9(4)
MOVE HIGH-VALUES TO WS-NUM
Now what will be the value of WS-NUM
MOVE LOW-VALUES TO WS-NUM
Now what will be the value of WS-NUM |
I wonder that work at all....
AFAIK.....If destination in a MOVE stmt is a numeric or numeric edited item, you cant pass HIGH-VALUES or LOW-VALUES to it....
Quote: |
01 WS-VAR PIC X(4)
MOVE HIGH-VALUES TO WS-VAR
Now what will be the value of WS-VAR
MOVE LOW-VALUES TO WS-VAR
------>ws-num = 0000. |
moving HIGH-VALUES will show FFFF, while LOW-VALUES does 0000.
Regards,
Priyesh. |
|
Back to top |
|
|
sendil
New User
Joined: 30 Jun 2005 Posts: 27
|
|
|
|
hi priyesh,
Your answer is correct FFFF/0000. This concept is mainly used in to locate key field, when you are using STARTBR,READNEXT or START command. The low and high values are inserted in a file by using PARM = 'LOW' or PARM='HIGH'. If you are inserting a low value record in a file, this record is considered as a first record.
Thanks
Sendil |
|
Back to top |
|
|
|