1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
* To save file1, file2, file3,etc. The trick is in the "save out" line.

DEFINE !Chart (!POS !CMDEND).
!LET !x=!NULL
!DO !vari !IN (!1).
!LET !x=!CONCAT(!x,"x")
compute NEWVAR=SQRT(!varI).
save out=!CONCAT("TEMP",!LENGTH(!x),".sav") / KEEP !vari newvar . !DOEND.
!ENDDEFINE.

!Chart A B C D .

*David Marso.
*SPSS Consultant.