Skip to content

Environment Variables

Daniel Long edited this page Sep 24, 2026 · 3 revisions

Environment Variables

Read environment variables at runtime with %GETENV:

DCL-S home VARCHAR(200);
DCL-S dbUrl VARCHAR(300);
DCL-S dspLine VARCHAR(52);   // DSPLY shows at most 52 characters

home = %GETENV('HOME');
dspLine = 'Home directory: ' + home;
DSPLY dspLine;

dbUrl = %GETENV('DATABASE_URL');
IF dbUrl = '';
  DSPLY 'No database configured';
ENDIF;

%GETENV returns an empty string if the variable is not set.

Clone this wiki locally