The following counterintuitive and irritating behaviour is observed
in version 20 and 15 and likely in all recent versions.
data list free /x. begin data 1 2 3 4 5 end data. dataset name oldset. temporary. numeric y. compute y= 10. select if x>3. matrix. get data. save data /outfile= *. end matrix. Look in 'oldset' dataset. There is all 5 cases - right, because SELECTing was TEMPORARY. Strangely, it is different with 'y' variable. The variable column is still unexpectedly there, although because of TEMPORARY it shouldn't be there anymore. But it is there, and you have to execute (Run pending transforms) for it to go. I was expecting and requiring that after END MATRIX was issued, everything temporary done with 'oldset' must get settled, even though 'oldset' isn't the active dataset anymore (the unnamed * set becomes active). What do you think and wouldn't it be regarded a bug? |
P.S. The same sort of muck appears not only with MATRIX but with
other procedures.
data list free /x1 x2. begin data 1 2 3 4 5 6 7 8 9 10 end data. dataset name oldset. temporary. numeric y. compute y= 10. select if x1>3. correlations x1 x2 /matrix= out(*). Y column (with zero valued cells) lingers in 'oldset'. |
This appears to be a harmless artifact
of preserving variables created by a procedure when temporary is in effect
such as regression residuals. If the procedure creates no data, the
temporary disappears as expected. Furthermore, although
the temporary variable lingers briefly and can be referred to in a transformation
run after the procedure, procedures cannot see it. That post transformation
or running another procedure also wipes out the temporary variable.
Jon Peck (no "h") aka Kim Senior Software Engineer, IBM [hidden email] phone: 720-342-5621 From: Kirill Orlov <[hidden email]> To: [hidden email], Cc: Jon K Peck/Chicago/IBM@IBMUS Date: 08/06/2013 06:08 AM Subject: Re: Possible defect: temporary variables persist as ghosts after MATRIX P.S. The same sort of muck appears not only with MATRIX but with other procedures. data list free /x1 x2. begin data 1 2 3 4 5 6 7 8 9 10 end data. dataset name oldset. temporary. numeric y. compute y= 10. select if x1>3. correlations x1 x2 /matrix= out(*). Y column (with zero valued cells) lingers in 'oldset'. |
Jon,
Thank you your testing it and the opinion. Although the "artifact" is surely harmless, it can scare a user (not experienced one) a lot. Imagine what they feel when they *see* that undead Y variable late evening, and that being with "wrong values" 0! How do they know they should press 'Run pending transform' to release it in the editor? So, I recommend you to file it as a defect. 06.08.2013 17:34, Jon K Peck пишет:
This appears to be a harmless artifact of preserving variables created by a procedure when temporary is in effect such as regression residuals. If the procedure creates no data, the temporary disappears as expected. Furthermore, although the temporary variable lingers briefly and can be referred to in a transformation run after the procedure, procedures cannot see it. That post transformation or running another procedure also wipes out the temporary variable. |
Free forum by Nabble | Edit this page |