FCMP Procedure

SUBROUTINE Statement

Declares (creates) an independent computational block of code that you can call using a CALL statement.
Standardizing Each Row of a Data Set

Creating a CALL Routine and a Function

Syntax

SUBROUTINE subroutine-name (argument-1, ..., argument-n) <VARARGS>
<KIND | GROUP='string'>;
... more-program-statements ...
ENDSUB;

Required Arguments

subroutine-name
specifies the name of a subroutine.
argument
specifies one or more arguments for the subroutine. Character arguments are specified by placing a dollar sign ($) after the argument name. In the following example, subroutine mysub(arg1, arg2 $, arg3, arg4 $); arg1 and arg3 are numeric arguments, and arg2 and arg4 are character arguments.
OUTARGS
specifies arguments from the argument list that the subroutine should update.
out-argument
specifies arguments from the argument list that you want the subroutine to update.

Optional Arguments

VARARGS
specifies that the subroutine supports a variable number of arguments. If you specify VARARGS, then the last argument in the subroutine must be an array.
GROUP='string'
KIND='string'
specifies a collection of items that have specific attributes.

Details

The SUBROUTINE statement enables you to declare (create) an independent computational block of code that you can call with a CALL statement. The definition of a subroutine begins with the SUBROUTINE statement and ends with an ENDSUB statement. You can use the OUTARGS statement in a SUBROUTINE statement to specify arguments from the argument list that the subroutine should update.