To set environment variables for UNIX COBOL programs from a shell, use the export or set command. To set environment variables from within the program, call POSIX functions setenv() or putenv().
For example, to set the environment variable MYFILE:
export MYFILE=/usr/mystuff/notes.txt
Example: setting and accessing environment variables
related references
Runtime environment variables