A procedure can have parameters of different kinds: input, output, input-output (bidirectional) and also some special types like temp-tables and datasets).
In the run statement it's optional to declare INPUT
(it's considered default) - all other directions must be specifically declared.
A procedure taking two integers as input and outputting a decimal.
PROCEDURE divideAbyB:
DEFINE INPUT PARAMETER piA AS INTEGER NO-UNDO.
DEFINE INPUT PARAMETER piB AS INTEGER NO-UNDO.
DEFINE OUTPUT PARAMETER pdeResult AS DECIMAL NO-UNDO.
pdeResult = piA / piB.
END PROCEDURE.
DEFINE VARIABLE de AS DECIMAL NO-UNDO.
RUN divideAbyB(10, 2, OUTPUT de).
DISPLAY de. //5.00
Parameters are totally optional. You can mix and match any way you want. The order of the parameters are up to you but it's handy to start with input and end with output - you have to put them in the right order in the run statement and mixing directions can be annoying.