Purpose
Creates a name scope that can be shared by all contained declarations and procedures.
Syntax
condition-prefix: package-name: PACKAGE EXPORTS (procedure);
Parameters
-
condition-prefix
-
Condition prefixes specified on a PACKAGE statement apply to all procedures contained in the package unless overridden on the PROCEDURE statement.
- package-name
- The name of the package.
- EXPORTS
-
Indicates the procedures for export. Specify either all (EXPORTS(*)) or specific named procedures. Exported procedures are made externally known outside of the package. If no EXPORTS option is specified, EXPORTS(*) is assumed.
Example
PKG: PACKAGE EXPORTS (SUB1 EXTERNAL(‘PLB’));
SUB1: PROC; /* will be external, callable as “PLB”) */
CALL SUB2();
END SUB1;
SUB2: PROC; /* will be internal, not exported */
PUT SKIP LIST (‘PACKAGE NAME = ‘, PACKAGENAME());
END SUB2;
END PKG;