Added tests for LOOP and SAMPLE commands
[pspp] / tests / compute.stat
1 title 'Test COMPUTE expressions'.
2
3 data list /w 1-3(a).
4 begin data.
5 123
6 456
7 919
8 572
9 end data.
10 *string y z(a6).
11 *compute y=ltrim(lpad(w,6,'*'),'*').
12 *compute z=rtrim(rpad(w,6,'*'),'*').
13 string z(a6).
14 compute x=number(w).
15 compute y=number(w,f8).
16 compute z=lpad(rpad(substr(string(x,f6),4,1),3,'@'),6,'*').
17 compute y=y+1e-10.
18 if(x<=456) y=500.
19 select if x<=456.
20 compute #caseseq=#caseseq+1.
21 list.
22 list.