Task

Show how to get one of your process's environment variables.

The available variables vary by system;   some of the common ones available on Unix include:

   PATH
   HOME
   USER


       IDENTIFICATION DIVISION.
       PROGRAM-ID. Environment-Vars.
 
       DATA DIVISION.
       WORKING-STORAGE SECTION.
       01  home PIC X(75).
 
       PROCEDURE DIVISION.
*          *> Method 1.      
           ACCEPT home FROM ENVIRONMENT "HOME"
           DISPLAY home
 
*          *> Method 2.
           DISPLAY "HOME" UPON ENVIRONMENT-NAME
           ACCEPT home FROM ENVIRONMENT-VALUE
 
           GOBACK
           .