PROC/END-PROC statement

The PROC and END-PROC statements are used to declare the beginning and the end of a procedure in the Activity section.

Syntax

Syntax

Read syntax diagramSkip visual syntax diagram&procname.PROCactivity statementsEND-PROC

Parameters

&procname
Procedure name 1 to 30 characters long. The name can consist of letters, numbers and hyphens. The first character and the last character must be a letter or a number.

Programming notes

Procedures are declared at the bottom of the script program. One or more procedures can be coded.

Procedures are invoked by means of the PERFORM statement as needed.

Procedures should be used for repetitive logic to make the script program manageable.

RMU does not support the GOTO statement. Therefore procedures must be written in a straight top-to-bottom design.

Examples

PERFORM A0001-DECORATE

A0001-DECORATE. PROC
     IF (LINE5 (2: 7) = 'COMPANY')
     AND (LINE5 (13: 6) = 'BRANCH')
     AND (LINE8 (4: 2) IS NUMERIC)
          EVALUATE LINE8-LINE55 (24: 4)
               WHEN  'DDDD'
                    LINE (24: 4) = .em1
               WHEN  'EBEE'
                    LINE (24: 4) = .em2
          END-EVALUATE
     END-IF
END-PROC