Macro Assistance

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Macro Assistance

Jimmy Byrd
I have the following example  program and want to save or append the
results of each iteration into one file. Any and all assistance is
greatly appreciated.
Jeremy

Example Program
_________________

DEFINE !TOTMAC ().
!DO !I = 1 !TO 10.
INPUT PROGRAM.
VECTOR X(2).
 LOOP #I = 1 TO 50.
 LOOP #J = 1 TO 2.
 COMPUTE X(#J) = NORMAL (25) +  50.
 END LOOP.
 END CASE.
 END LOOP.
 END FILE.
END INPUT PROGRAM.
COMPUTE X1=X2*.45+x1*SQRT(1-.45**2) .
CORRELATIONS VARIABLES=x1 x2
/VARIABLES=x1 x2
/MATRIX OUT(*).
FLIP
  VARIABLES=  X1 to X2.
FILTER OFF.
use  1 thru  1 /permanent .
EXECUTE .
RENAME VARIABLES (var004 =N   ).
RENAME VARIABLES (var006=R  ).
COMPUTE BIAS = R / (2 * N - 1) .
COMPUTE #ZR = .5* (LN ((1 + R) / (1 - R))).
COMPUTE ZLower = #ZR - BIAS - 1.98  *  (SQRT (1/(N-3)) )  .
COMPUTE ZUpper = #ZR - BIAS   + 1.98   *  (SQRT (1/(N-3))) .
  COMPUTE RUP = (EXP  ( 2 * ZUpper)  - 1)  /  (EXP   (2 * ZUpper)  + 1)
.
COMPUTE RLOW = (EXP   (2 * ZLower)   - 1 )  /  (EXP   (2 * ZLower)  +
1) .
EXECUTE .
SAVE OUTFILE='E:\corr.sps'.
!DOEND
!ENDDEFINE
!TOTMAC
Execute.