Using XSAVE in a LOOP in SPSS 15, I got a new warning message:
>Warning # 142. Command name: XSAVE >LOOP has no effect on this command. What is it intended to mean? XSAVE is, has always been, a transformation command. In a LOOP, it's executed once per loop pass, though execution may be suppressed by DO IF within the LOOP. It seems to work the way it always has; see SPSS 15 draft output, below. What gives? * C:\Documents and Settings\Richard\My Documents . * \Technical\spssx-l\Z-2007a . * \2007-02-24 Ristow - SPSS 15 LOOP-XSAVE warning message.SPS . * For posting. FILE HANDLE Expand /NAME='C:\Documents and Settings\Richard\My Documents\Temporary\SPSS\' + '2007-02-24 Ristow - SPSS 15 LOOP-XSAVE warning message' + ' - ' + 'EXPAND.SAV'. NEW FILE. DATA LIST FREE / Ltrs (A3). BEGIN DATA AAA BBB CCC END DATA. LIST. List |-----------------------------|---------------------------| |Output Created |23-FEB-2007 21:30:29 | |-----------------------------|---------------------------| Ltrs AAA BBB CCC Number of cases read: 3 Number of cases listed: 3 NUMERIC INSTANCE (F3). LOOP INSTANCE = 1 TO $CASENUM. . XSAVE OUTFILE=Expand. >Warning # 142. Command name: XSAVE >LOOP has no effect on this command. END LOOP. EXECUTE. GET FILE=Expand. LIST. List |-----------------------------|---------------------------| |Output Created |23-FEB-2007 21:30:30 | |-----------------------------|---------------------------| C:\Documents and Settings\Richard\My Documents\Temporary\SPSS \2007-02-24 Ristow - SPSS 15 LOOP-XSAVE warning message - EXPAND.SAV Ltrs INSTANCE AAA 1 BBB 1 BBB 2 CCC 1 CCC 2 CCC 3 Number of cases read: 6 Number of cases listed: 6 |
Take out the LOOP and you'll get identical results. Loop doesn't control the XSAVE.
-----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Richard Ristow Sent: Friday, February 23, 2007 11:38 PM To: [hidden email] Subject: SPSS 15 LOOP-XSAVE warning message Using XSAVE in a LOOP in SPSS 15, I got a new warning message: >Warning # 142. Command name: XSAVE >LOOP has no effect on this command. What is it intended to mean? XSAVE is, has always been, a transformation command. In a LOOP, it's executed once per loop pass, though execution may be suppressed by DO IF within the LOOP. It seems to work the way it always has; see SPSS 15 draft output, below. What gives? * C:\Documents and Settings\Richard\My Documents . * \Technical\spssx-l\Z-2007a . * \2007-02-24 Ristow - SPSS 15 LOOP-XSAVE warning message.SPS . * For posting. FILE HANDLE Expand /NAME='C:\Documents and Settings\Richard\My Documents\Temporary\SPSS\' + '2007-02-24 Ristow - SPSS 15 LOOP-XSAVE warning message' + ' - ' + 'EXPAND.SAV'. NEW FILE. DATA LIST FREE / Ltrs (A3). BEGIN DATA AAA BBB CCC END DATA. LIST. List |-----------------------------|---------------------------| |Output Created |23-FEB-2007 21:30:29 | |-----------------------------|---------------------------| Ltrs AAA BBB CCC Number of cases read: 3 Number of cases listed: 3 NUMERIC INSTANCE (F3). LOOP INSTANCE = 1 TO $CASENUM. . XSAVE OUTFILE=Expand. >Warning # 142. Command name: XSAVE >LOOP has no effect on this command. END LOOP. EXECUTE. GET FILE=Expand. LIST. List |-----------------------------|---------------------------| |Output Created |23-FEB-2007 21:30:30 | |-----------------------------|---------------------------| C:\Documents and Settings\Richard\My Documents\Temporary\SPSS \2007-02-24 Ristow - SPSS 15 LOOP-XSAVE warning message - EXPAND.SAV Ltrs INSTANCE AAA 1 BBB 1 BBB 2 CCC 1 CCC 2 CCC 3 Number of cases read: 6 Number of cases listed: 6 |
At 03:19 PM 2/24/2007, Beadle, ViAnn wrote:
>Take out the LOOP and you'll get identical results. Loop doesn't >control the XSAVE. Perhaps I'm missing something? I've controlled XSAVEs with LOOPs for years; it's the way to write multiple cases from one case, if VARSTOCASES isn't adequate. And the results don't seem identical. From the run with LOOP (see complete code in previous posting): GET FILE=Expand. LIST. List |-----------------------------|---------------------------| |Output Created |23-FEB-2007 21:30:30 | |-----------------------------|---------------------------| C:\Documents and Settings\Richard\My Documents\Temporary\SPSS \2007-02-24 Ristow - SPSS 15 LOOP-XSAVE warning message - EXPAND.SAV Ltrs INSTANCE AAA 1 BBB 1 BBB 2 CCC 1 CCC 2 CCC 3 Number of cases read: 6 Number of cases listed: 6 From the same code, but with LOOP and END LOOP commented out (see complete code, below). "INSTANCE" is now missing, because it was the loop counter. But why three records, instead of six, if the LOOP had no effect? GET FILE=Expand. LIST. List |-----------------------------|---------------------------| |Output Created |24-FEB-2007 21:05:36 | |-----------------------------|---------------------------| C:\Documents and Settings\Richard\My Documents\Temporary\SPSS \2007-02-24 Ristow - SPSS 15 LOOP-XSAVE warning message - EXPAND.SAV Ltrs INSTANCE AAA . BBB . CCC . Number of cases read: 3 Number of cases listed: 3 ...................................................... Complete run, with LOOP commented out: * C:\Documents and Settings\Richard\My Documents . * \Technical\spssx-l\Z-2007a . * \2007-02-24 Ristow - SPSS 15 LOOP-XSAVE warning message.SPS . * For posting. FILE HANDLE Expand /NAME='C:\Documents and Settings\Richard\My Documents\Temporary\SPSS\' + '2007-02-24 Ristow - SPSS 15 LOOP-XSAVE warning message' + ' - ' + 'EXPAND.SAV'. NEW FILE. DATA LIST FREE / Ltrs (A3). BEGIN DATA AAA BBB CCC END DATA. LIST. List |-----------------------------|---------------------------| |Output Created |24-FEB-2007 21:05:36 | |-----------------------------|---------------------------| Ltrs AAA BBB CCC Number of cases read: 3 Number of cases listed: 3 NUMERIC INSTANCE (F3). *--LOOP INSTANCE = 1 TO $CASENUM. . XSAVE OUTFILE=Expand. *--END LOOP. EXECUTE. GET FILE=Expand. LIST. List |-----------------------------|---------------------------| |Output Created |24-FEB-2007 21:05:36 | |-----------------------------|---------------------------| C:\Documents and Settings\Richard\My Documents\Temporary\SPSS \2007-02-24 Ristow - SPSS 15 LOOP-XSAVE warning message - EXPAND.SAV Ltrs INSTANCE AAA . BBB . CCC . Number of cases read: 3 Number of cases listed: 3 |
I must confess that I am also mystified by this warning. There is an example in the data management book that uses XSave with Loop to "expand" single cases into multiple cases. AFAIK, prior to SPSS 15, it didn't produce this warning, but now it does. It still works, but you get this warning in the middle of the XSave command.
DATA LIST FREE /Age Female Male. BEGIN DATA 20 2 2 21 0 0 22 1 4 23 3 0 24 0 1 END DATA. LOOP #cnt=1 to SUM(Female, Male). - COMPUTE Gender = (#cnt > Female). - XSAVE OUTFILE="c:\temp\tempdata.sav" /KEEP Age Gender. END LOOP. GET FILE='c:\temp\tempdata.sav'. -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Richard Ristow Sent: Saturday, February 24, 2007 11:16 PM To: [hidden email] Subject: Re: SPSS 15 LOOP-XSAVE warning message At 03:19 PM 2/24/2007, Beadle, ViAnn wrote: >Take out the LOOP and you'll get identical results. Loop doesn't >control the XSAVE. Perhaps I'm missing something? I've controlled XSAVEs with LOOPs for years; it's the way to write multiple cases from one case, if VARSTOCASES isn't adequate. And the results don't seem identical. From the run with LOOP (see complete code in previous posting): GET FILE=Expand. LIST. List |-----------------------------|---------------------------| |Output Created |23-FEB-2007 21:30:30 | |-----------------------------|---------------------------| C:\Documents and Settings\Richard\My Documents\Temporary\SPSS \2007-02-24 Ristow - SPSS 15 LOOP-XSAVE warning message - EXPAND.SAV Ltrs INSTANCE AAA 1 BBB 1 BBB 2 CCC 1 CCC 2 CCC 3 Number of cases read: 6 Number of cases listed: 6 From the same code, but with LOOP and END LOOP commented out (see complete code, below). "INSTANCE" is now missing, because it was the loop counter. But why three records, instead of six, if the LOOP had no effect? GET FILE=Expand. LIST. List |-----------------------------|---------------------------| |Output Created |24-FEB-2007 21:05:36 | |-----------------------------|---------------------------| C:\Documents and Settings\Richard\My Documents\Temporary\SPSS \2007-02-24 Ristow - SPSS 15 LOOP-XSAVE warning message - EXPAND.SAV Ltrs INSTANCE AAA . BBB . CCC . Number of cases read: 3 Number of cases listed: 3 ...................................................... Complete run, with LOOP commented out: * C:\Documents and Settings\Richard\My Documents . * \Technical\spssx-l\Z-2007a . * \2007-02-24 Ristow - SPSS 15 LOOP-XSAVE warning message.SPS . * For posting. FILE HANDLE Expand /NAME='C:\Documents and Settings\Richard\My Documents\Temporary\SPSS\' + '2007-02-24 Ristow - SPSS 15 LOOP-XSAVE warning message' + ' - ' + 'EXPAND.SAV'. NEW FILE. DATA LIST FREE / Ltrs (A3). BEGIN DATA AAA BBB CCC END DATA. LIST. List |-----------------------------|---------------------------| |Output Created |24-FEB-2007 21:05:36 | |-----------------------------|---------------------------| Ltrs AAA BBB CCC Number of cases read: 3 Number of cases listed: 3 NUMERIC INSTANCE (F3). *--LOOP INSTANCE = 1 TO $CASENUM. . XSAVE OUTFILE=Expand. *--END LOOP. EXECUTE. GET FILE=Expand. LIST. List |-----------------------------|---------------------------| |Output Created |24-FEB-2007 21:05:36 | |-----------------------------|---------------------------| C:\Documents and Settings\Richard\My Documents\Temporary\SPSS \2007-02-24 Ristow - SPSS 15 LOOP-XSAVE warning message - EXPAND.SAV Ltrs INSTANCE AAA . BBB . CCC . Number of cases read: 3 Number of cases listed: 3 |
This is a known 'bug' in SPSS 15. Just ignore the warning.
Regards, George ----- Original Message ----- From: "Oliver, Richard" <[hidden email]> To: <[hidden email]> Sent: Sunday, February 25, 2007 2:20 PM Subject: Re: SPSS 15 LOOP-XSAVE warning message >I must confess that I am also mystified by this warning. There is an >example in the data management book that uses XSave with Loop to "expand" >single cases into multiple cases. AFAIK, prior to SPSS 15, it didn't >produce this warning, but now it does. It still works, but you get this >warning in the middle of the XSave command. > > DATA LIST FREE > /Age Female Male. > BEGIN DATA > 20 2 2 > 21 0 0 > 22 1 4 > 23 3 0 > 24 0 1 > END DATA. > LOOP #cnt=1 to SUM(Female, Male). > - COMPUTE Gender = (#cnt > Female). > - XSAVE OUTFILE="c:\temp\tempdata.sav" > /KEEP Age Gender. > END LOOP. > GET FILE='c:\temp\tempdata.sav'. > > -----Original Message----- > From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of > Richard Ristow > Sent: Saturday, February 24, 2007 11:16 PM > To: [hidden email] > Subject: Re: SPSS 15 LOOP-XSAVE warning message > > At 03:19 PM 2/24/2007, Beadle, ViAnn wrote: > >>Take out the LOOP and you'll get identical results. Loop doesn't >>control the XSAVE. > > Perhaps I'm missing something? I've controlled XSAVEs with LOOPs for > years; it's the way to write multiple cases from one case, if > VARSTOCASES isn't adequate. > > And the results don't seem identical. From the run with LOOP (see > complete code in previous posting): > > GET FILE=Expand. > LIST. > > List > |-----------------------------|---------------------------| > |Output Created |23-FEB-2007 21:30:30 | > |-----------------------------|---------------------------| > C:\Documents and Settings\Richard\My Documents\Temporary\SPSS > \2007-02-24 Ristow - SPSS 15 LOOP-XSAVE warning message - EXPAND.SAV > > Ltrs INSTANCE > > AAA 1 > BBB 1 > BBB 2 > CCC 1 > CCC 2 > CCC 3 > > Number of cases read: 6 Number of cases listed: 6 > > From the same code, but with LOOP and END LOOP commented out (see > complete code, below). "INSTANCE" is now missing, because it was the > loop counter. But why three records, instead of six, if the LOOP had no > effect? > > GET FILE=Expand. > LIST. > > List > |-----------------------------|---------------------------| > |Output Created |24-FEB-2007 21:05:36 | > |-----------------------------|---------------------------| > C:\Documents and Settings\Richard\My Documents\Temporary\SPSS > \2007-02-24 Ristow - SPSS 15 LOOP-XSAVE warning message - EXPAND.SAV > > Ltrs INSTANCE > > AAA . > BBB . > CCC . > > Number of cases read: 3 Number of cases listed: 3 > > ...................................................... > Complete run, with LOOP commented out: > > * C:\Documents and Settings\Richard\My Documents . > * \Technical\spssx-l\Z-2007a . > * \2007-02-24 Ristow - SPSS 15 LOOP-XSAVE warning message.SPS . > > * For posting. > > FILE HANDLE Expand > /NAME='C:\Documents and Settings\Richard\My > Documents\Temporary\SPSS\' + > '2007-02-24 Ristow - SPSS 15 LOOP-XSAVE warning > message' + > ' - > ' + > 'EXPAND.SAV'. > > NEW FILE. > DATA LIST FREE / Ltrs (A3). > BEGIN DATA > AAA BBB CCC > END DATA. > > LIST. > > List > |-----------------------------|---------------------------| > |Output Created |24-FEB-2007 21:05:36 | > |-----------------------------|---------------------------| > Ltrs > > AAA > BBB > CCC > > Number of cases read: 3 Number of cases listed: 3 > > > NUMERIC INSTANCE (F3). > *--LOOP INSTANCE = 1 TO $CASENUM. > . XSAVE OUTFILE=Expand. > *--END LOOP. > EXECUTE. > > GET FILE=Expand. > LIST. > > List > |-----------------------------|---------------------------| > |Output Created |24-FEB-2007 21:05:36 | > |-----------------------------|---------------------------| > C:\Documents and Settings\Richard\My Documents\Temporary\SPSS > \2007-02-24 Ristow - SPSS 15 LOOP-XSAVE warning message - EXPAND.SAV > > Ltrs INSTANCE > > AAA . > BBB . > CCC . > > Number of cases read: 3 Number of cases listed: 3 |
Free forum by Nabble | Edit this page |