Re: Reset data
- From: "William M. Klein" <wmklein@xxxxxxxxxxxxxxxxx>
- Date: Wed, 28 Feb 2007 04:16:47 GMT
Pete,
Although NOT related to this specific example, there was one time that there
USED to be a "good reason" for using
Move Table1 to Tabl
instead of
Initialize Tabl
In the '85 Standard (when INITIALIZE was introduced) it was "non-conforming" to
try to INITIALIZE a record that included an OCCURS DEPENDING ON item in it, i.e.
a "variable occurrence table". Although SOME vendors provided extensions to
allow this, it was not made "legal" source code until the '02 Standard.
Therefore, one could initialize a full table (including various Comp-? fields)
only by "saving" an initial value table and moving it to the target one.
There was also the whole question of whether one did or did not want to
initialize FILLER fields and initialize "to VALUE clause". Again, both of
these were made "standard" in the '02 Standard, but were only available as
extensions in a FEW compilers before that.
Again, for THE specific example, below, using the "MOVE ZERO-TABLE to TABELLE"
seems unnecessary. Also, as all the fields are DISPLAY NUMERIC without SIGNS, I
would guess that a MOVE ZERO should work OK (although I have rarely seen
'real-world' examples where this works as desired).
--
Bill Klein
wmklein <at> ix.netcom.com
"Pete Dashwood" <dashwood@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:54k41rF20ig9pU1@xxxxxxxxxxxxxxxxxxxxx
"Howard Brazee" <howard@xxxxxxxxxx> wrote in message
news:chv5u214c3r2strckf1h2r8msh9pv42ne5@xxxxxxxxxx
On Mon, 26 Feb 2007 10:13:41 +0100, "Mitch Steens" <M.Steens@xxxxxxx>
wrote:
I have the following datatype:
03 tabelle.
05 occurs 9.
07 occurs 9.
10 elem.
12 elem-a pic 9.
12 elem-b pic 9.
How can I reset the datatype, so that no value is set?
What do you mean by "no value". This is space in the computer
memory. Whatever happens to be in memory is a "value", whether or
not if it is a valid value.
One thing I sometimes do in a program with such a table (especially if
some of the variables are packed or binary), is to create an
initialization table. If I need to reinitialize the table, I just
MOVE ZERO-TABLE to TABELLE.
Again, something I don't understand.
How would the result of doing that (taking twice as much storage as you
actually need, and running the risk of forgetting to update one of the tables
when the structure changes) differ from...
INITIALIZE TABELLE ?
Pete.
.
- Follow-Ups:
- Re: Reset data
- From: Pete Dashwood
- Re: Reset data
- References:
- Reset data
- From: Mitch Steens
- Re: Reset data
- From: Howard Brazee
- Re: Reset data
- From: Pete Dashwood
- Reset data
- Prev by Date: Re: Reset data
- Next by Date: Re: Reset data
- Previous by thread: Re: Reset data
- Next by thread: Re: Reset data
- Index(es):
Relevant Pages
|