Professional Documents
Culture Documents
Sy1ta67
ACCEPT DATAITEM!"
ACCEPT DATAITEM#"
D$sp%a& statement *s .se/ to /*sp,ay the o.tp.t fro+ the /ata
*te+ to the SYSO!T wh*4h *s *1 the 2ob Spoo,.
Sy1ta67
MOVE DATAITEM/CONSTANT TO DATAITEM#(DATAITEM)*
Move state+e1t 4a1 be /o1e *1 /*ffere1t types
Sy1ta6
0# EMP-$% 0# EMP-$%.
ADD
S!BT"ACT
M!LTIPLY
DIVIDE
COMP!TE
Arit*meti) VERBS
The ADD state+e1t s.+s two or +ore 1.+er*4 opera1/s a1/ stores
the res.,t.
Sy1ta6'<
ADD B */e1t*f*er'< ,*tera,'< C D */e1t*f*er'@ ,*tera,'@ E . . .
TO */e1t*f*er'F D */e1t*f*er'G E . . .
Sy1ta6'@
ADD B */e1t*f*er'< ,*tera,'< C B */e1t*f*er'@ ,*tera,'@ C
D */e1t*f*er'F ,*tera,'F E $IVIN$ */e1t*f*er'G . . .
ADD VERB
Before
WS;;'IN< <@F
WS;;'O!T< ;;;;
After
WS;;'IN< <@F
WS;;'O!T< ;<@F
Before
WS;;'IN< <@F
WS;;'O!T@ ;;;;
After
WS;;'IN< <@F
WS;;'O!T@ ;@@F
Before
WS;;'IN< <@F
WS;;'IN@ G=H
WS;;'O!T@ ;;;;
After
WS;;'IN< <@F
WS;;'IN@ G=H
WS;;'O!T@ ;=I>
ADD
The S!BT"ACT state+e1t s.btra4ts o1e 1.+er*4 *te+ or the
s.+ of two or +ore 1.+er*4 *te+s fro+ o1e or +ore 1.+er*4
*te+s a1/ stores the res.,t.
Sy1ta6
S!BT"ACT B */e1t*f*er'< ,*tera,'< C D */e1t*f*er'@ ,*tera,'@ E
. . .
#"OM */e1t*f*er'F D */e1t*f*er'G E
D $IVIN$ */e1t*f*er'= D */e1t*f*er'H E . . . E
S+BTRACT VERB
Before
WS;;'IN< <<<
WS;;'O!T< <<<<
After
WS;;'IN< <<<
WS;;'O!T< <;;;
Before
WS;;'IN< <<<
WS;;'O!T@ @@@@
After
WS;;'IN< <<<
WS;;'O!T@ @;;;
Before
WS;;'IN< <<<
WS;;'IN@ ===
WS;;'O!TF HHHH
WS;;'O!TG >HHH
After
WS;;'IN< <<<
WS;;'IN@ ===
WS;;'O!TF HHHH
WS;;'O!TG H;;;
S!BT"ACT
The M!LTIPLY state+e1t +.,t*p,*es 1.+er*4 *te+s a1/ sets the
va,.es of /ata *te+s e3.a, to the res.,ts
Sy1ta6
M!LTIPLY B */e1t*f*er'< ,*tera,'< C BY */e1t*f*er'@
D */e1t*f*er'F E . . .
D $IVIN$ */e1t*f*er'G D */e1t*f*er'= E . . . E
M+LTIPL, VERB
Before
WS;;'IN< <;;
WS;;'O!T< <<<<
After
WS;;'IN< <;;
WS;;'O!T< <;;;
Before
WS;;'IN@ <;
WS;;'O!T@ ;@@@
WS;;'O!TF ;HHH
After
WS;;'IN@ <;
WS;;'O!T@ ;@@@
WS;;'O!TF @@@;
M!LTIPLY
"
The DIVIDE state+e1t /*v*/es o1e 1.+er*4 /ata *te+ *1to or by other?s- a1/ sets
the va,.es of /ata *te+s e3.a, to the 3.ot*e1t a1/ re+a*1/er.
Sy1ta6'<
DIVIDE B */e1t*f*er'< ,*tera,'< C INTO */e1t*f*er'@ D */e1t*f*er'@ E . . . D
$IVIN$ */e1t*f*er'G D */e1t*f*er'= E . . . E ..
Sy1ta6'@
DIVIDE B */e1t*f*er'< ,*tera,'< C BY B */e1t*f*er'@ ,*tera,'@ C
$IVIN$ */e1t*f*er'F D */e1t*f*er'G E.
Sy1ta6'F
DIVIDE B */e1t*f*er'< ,*tera,'< C B INTO BY C B */e1t*f*er'@ ,*tera,'@ C
$IVIN$ */e1t*f*er'F "EMAINDE" */e1t*f*er'G.
DIVIDE VERB
Before
WS;;'IN< <;;
WS;;'O!T< <;;;
After
WS;;'IN< <;;
WS;;'O!T< ;;<;
Before
WS;;'IN@ <;
WS;;'O!T@ @;;;
WS;;'O!TF ;;
After
WS;;'IN@ <;
WS;;'O!T@ ;;;J
WS;;'O!TF <H
DIVIDE
T*e
COMP+TE
{ } COMPUTE I.ent$/$e0 1 ROUNDED 2 " " " 3 A0$t4met$cE'p0ess$+n
ON SI5E ERROR
NOT ON SI5E ERROR
StatementB%+c6 END COMPUTE
'
1
]
1
Precedence Rules.
1. ** = POWER NN
2. * = MULTIPLY x
/ = DIVIDE
. ! = "DD !
# = $U%TR"&T #
.
T*e RO+DED o#tion
Rece'('n) *'eld "c+u,l Resul+ Trunc,+ed Resul+ R-unded Resul+
PI& ./0V.. 12.21
PI& ./0. 12.21
1".." 1"...
1". 1".