Use the following construct to access environment variables from the COBOL source code:
working-storage section.
01 val pic x(100).
Procedure division.
display "USERNAME" upon environment-name
accept val from environment-value
display val
goback.
...