IBM InfoSphere DataStage, Version 11.3.1
SUBROUTINE statement
Syntax
SUBROUTINE [name] [ ( [MAT] variable [ , [MAT] variable ... ] ) ]
Description
Use the SUBROUTINE statement to identify an external subroutine. The SUBROUTINE statement must be the first line in the subroutine that is not a comment line. Each external subroutine can contain only one SUBROUTINE statement.
An external subroutine is a separate program or set of statements that can be executed by other programs or subroutines (called calling programs) to perform a task. The external subroutine must be compiled and cataloged before another program can call it.
The SUBROUTINE statement can specify a subroutine name for documentation purposes; it need not be the same as the program name or the name by which it is called. The CALL statement must reference the subroutine by its name in the catalog, in the VOC file, or in the object file.
variables are variable names used in the subroutine to pass values between the calling programs and the subroutine. To pass an array, you must precede the array name with the keyword MAT. When an external subroutine is called, the CALL statement must specify the same number of variables as are specified in the SUBROUTINE statement. See the CALL statement for more information.
Example
The following SUBROUTINE statements specify three variables, EM, GROSS, and TAX, the values of which are passed to the subroutine by the calling program:
SUBROUTINE ALONE(EM, GROSS, TAX)
SUBROUTINE STATE(EM,GROSS,TAX)
Last updated: 2015-03-09
PDF version of this information: