Skip to content

Environment Variables

danlong005 edited this page Aug 30, 2026 · 3 revisions

Environment Variables

Read environment variables at runtime with %GETENV:

DCL-S home VARCHAR(200);
DCL-S dbUrl VARCHAR(300);

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

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