A simple on/off or enumerated setting that changes program behavior at runtime: enable tracing, choose TEST vs PROD endpoints, toggle features during rollout.
Like light switches in a room—flip them on/off to change what’s active without rewiring the house.
1234ACCEPT ENABLE-TRACE FROM ENVIRONMENT 'APP_TRACE' IF ENABLE-TRACE = 'Y' PERFORM TRACE-INIT END-IF
12//STEP1 EXEC PGM=MYPROG,PARM='TRACE=Y,ENDPOINT=TEST' //MYCONF DD DISP=SHR,DSN=TEAM.CONFIG(MYAPP)
Program reads PARM or a control dataset to set flags.
123TRACE=Y ENDPOINT=TEST RETRIES=3
Read once at startup; store in WORKING-STORAGE. Log effective config.
1234567801 ENABLE-TRACE PIC X VALUE 'N'. 01 TARGET-ENV PIC X(4) VALUE 'PROD'. ... IF TARGET-ENV = 'TEST' MOVE 'https://test.api' TO API-URL ELSE MOVE 'https://prod.api' TO API-URL END-IF
Expose simple flags. Hide parsing/IO behind initialization routine.
Source | How | Example |
---|---|---|
ENV | ACCEPT FROM ENVIRONMENT | APP_TRACE |
JCL | PARM / Symbols | PARM='TRACE=Y' |
Dataset | Read key=value | TRACE=Y |
1. Are switches a COBOL verb?
2. Where should flags be defined?
3. How to load runtime values?