ENDLOCAL

 ─ENDLOCAL()─────────────

ENDLOCAL restores the drive directory and environment variables in effect before the last SETLOCAL function was executed. If ENDLOCAL is not included in a procedure, then the initial environment saved by SETLOCAL will be restored upon exiting the procedure.

ENDLOCAL returns a value of 1 if the initial environment is successfully restored, and a value of 0 if no SETLOCAL has been issued or if the actions is otherwise unsuccessful.

┴╓: Unlike their counterparts in the OS/2 Batch language (the Setlocal and Endlocal statements), the REXX SETLOCAL and ENDLOCAL functions can be nested.