Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

diff between 'move all' and 'move'

Status
Not open for further replies.

jayachandran

Technical User
May 3, 2002
1
0
0
SG
Hi!
What is the difference between 'MOVE ALL ZEROS TO VARIABLE' and 'MOVE ZEROS TO VARIABLE' ?
What happens if the VARIABLE is numeric and when non-numeric (PIC X) ?

 
Ah, a fun set of questions!

The answer to your first question is: there is no difference. The reserved word ALL in this context is optional.

As to your second question: ZEROS, ZEROES, ALL ZEROES, ALL ZEROS, ZERO, ALL ZERO are equivalent figurative constants that represent the numeric value 0 when VARIABLE is numeric, and one or more zero character(s) when VARIABLE is alphanumeric or group.

There is a difference in the following, however (assume VARIABLE is alphanumeric, two or more characters):
Code:
MOVE 'X' TO VARIABLE
MOVE ALL 'X' TO VARIABLE
In the first instance, a single 'X' is left justified in VARIABLE, with space fill to the right. In the second instance, all character positions in VARIABLE will contain 'X'. Want a quick separation line in a report? Consider
Code:
WRITE REPORT-LINE FROM ALL '_' AFTER 1.
Tom Morrison
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top