How to calculate multiple variable in a calculation thru loop/macro

Posted by Satish on
URL: http://spssx-discussion.165.s1.nabble.com/How-to-calculate-multiple-variable-in-a-calculation-thru-loop-macro-tp5741015.html

Respected Members,

Need your support on below mentioned queries.

Actually I have to perform below mentioned calculation for 200 variables which is very tough to manage in daily basis one by one. Please help me how I can generate 200 different variable for 200 different variables.

variables starting from "_1" to "_200". Prefix for target variable will be "SAT_NUM_DIS_" and only last digit (_1) will will change.

Prefix for existing variable will be different for each of them like "Q8A_" and "Q8B_".

1.

COMPUTE SAT_NUM_DIS_1=0.
IF (SAT_NUM_AVA_1=1 OR (Q8A_1=1 AND Q8B_1=1))SAT_NUM_DIS_1=1.
EXECUTE.

2.

COMPUTE SAT_NUM_OOS_1=$SYSMIS.
IF(SAT_NUM_DIS_1=1)SAT_NUM_OOS_1=0.
EXECUTE.

Thanks in advance

Regards