Perform a paragraph and pass arguments.
PERFORM paragraphname (actualargument1[[,] ... actualargument2[,] ... actualargumentN]) . . . PARA paragraphname ([+|-]formalargument1[[,] ... [+|-]formalargument2[,] ... [+|-]formalargumentN])
+|- |
A plus (+) or minus (-) sign preceding a formalargument passes values between actual arguments and formal arguments, as follows: |
With a plus sign (+), PERFORM passes the actualargument value to formalargument after the paragraph executes. The program does not return the formalargument value to actualargument. |
|
With a minus sign (-), PERFORM passes the formalargument value to the actualargument after the paragraph executes. |
|
If there is no plus or minus sign, the PERFORM passes the actualargument to its corresponding formalargument. After the paragraph executes, PERFORM passes the formalargument back to its corresponding actualargument. |
|
actualargu-ment |
Values you send to or receive from a formalargument in the paragraph; can be literals, identifiers, arithmetic expressions, variables, or index names. |
formal-argument |
Values you receive from or send to an actualargument in the PERFORM statement. |
paragraph-name |
Name of paragraph to perform. |
PERFORM PARA-1( 'ABC', ABC-FLD, RESULT) . . . PARA-1( +ARG1, +ARG2, -'Y')
MOVE 'ABC' TO ARG-1 MOVE ABC-FLD TO ARG2 PERFORM PARA-1 THRU ....... MOVE 'Y' TO RESULT
000100 NTRY . . . 003010 IF CLASS = 'HALF-TIME' 003020 PERFORM GET-SALARY( 20, 003021 ... HOURLY-RATE, WEEKLY-PAY) 003030 ELSE 003040 PERFORM GET-SALARY( 40, 003041 ... HOURLY-RATE, WEEKLY-PAY) 003050 WEEKLY-PAY = WEEKLY-PAY * TAX 003060 COMPUTE MEDICAL-DEDUC = 003061 ... HOURLY-RATE * 1.50 . . . 005010 PARA GET-SALARY( +HOURS-WORKED, 005011 ... PAY-RATE,-TOT-PAY) 005020 TOT-PAY = HOURS-WORKED * PAY-RATE .