HELPLIB.HLB  —  COBOL  PROCEDURE_DIVISION, DISPLAY  5format_envlog_name_extensions, Example
  Example of Formats 5 and 6.

 IDENTIFICATION DIVISION.
 PROGRAM-ID. SAMPLE.
 ENVIRONMENT DIVISION.
 CONFIGURATION SECTION.
 SPECIAL-NAMES.
   ENVIRONMENT-NAME    IS NAME-OF-EVAR
   ENVIRONMENT-VALUE   IS VALUE-OF-EVAR.
 DATA DIVISION.
 WORKING-STORAGE SECTION.
 01 NAME-1                  PIC X(20).
 01 VALUE-ACCEPTED          PIC X(20).
 PROCEDURE DIVISION.
 P1.
 *       The name of the environment variable
         MOVE "TESTPATH1" TO NAME-1.

 *       Create an environment with the name "TESTPATH1"
         DISPLAY NAME-1 UPON NAME-OF-EVAR.

 *       Set the value of "TESTPATH1"
         DISPLAY "/USER/MYNAME" UPON VALUE-OF-EVAR.

 *       Read the value of TESTPATH1 into a variable
         ACCEPT VALUE-ACCEPTED FROM VALUE-OF-EVAR.

 *       Display the value of TESTPATH1"
         DISPLAY VALUE-ACCEPTED.

         STOP RUN.
Close Help