Another idea:
DEFINE FILE CAR
CNT/I5 WITH CAR = CNT + 1;
FIELD1/D12.2 WITH CAR = DECODE CNT (
1 5
2 5
3 5
4 5
5 5
);
FIELD2/D12.2 WITH CAR = DECODE CNT (
1 10
2 10
3 10
4 10
5 10
);
FIELD3/A1 WITH CAR = DECODE CNT (
1 '*'
2 '/'
3 '+'
4 '-'
5 '?'
);
END
-*
TABLE FILE CAR
PRINT FIELD1 FIELD2 FIELD3
WHERE RECORDLIMIT EQ 5
ON TABLE HOLD AS TESTFILE FORMAT ALPHA
END
-*
DEFINE FILE TESTFILE
NEWVALUE/D12.2 = IF FIELD3 EQ '*' THEN FIELD1 * FIELD2
ELSE IF FIELD3 EQ '/' THEN FIELD1 / FIELD2
ELSE IF FIELD3 EQ '+' THEN FIELD1 + FIELD2
ELSE IF FIELD3 EQ '-' THEN FIELD1 - FIELD2
ELSE 0.00;
END
-*
TABLE FILE TESTFILE
PRINT FIELD1 FIELD3 FIELD2 NEWVALUE
END
-*
Jim
WF DevStu 5.2.6/WF Srv 5.2.4/Win NT 5.2