PERFORM Examples


Example 1:

 

  

PERFORM

NDX OF JULNDATE,CENTDATE,GREGDATE

 

If the numeric variable NDX has a value of 1, the subroutine designated by the Program Execution Label JULNDATE is initiated. If it has a value of 2, the subroutine designated by CENTDATE is initiated; A value of 3 diverts program execution to GREGDATE. If NDX has any other value, control is passed to the next sequential instruction.

 

Example 2:

 

  

PERFORM

NDX OF ,ERROR,,,,ERRORBIG

 

If the numeric variable NDX has a value of 2, the subroutine designated by the Program Execution Label ERROR is initiated. If it has a value of 6, the subroutine designated by ERRORBIG is initiated. If NDX has any other value, control is passed to the next sequential instruction.

 



PL/B Language Reference PAUSE Example PERFORMF Examples