The SQL statement SET changes special registers inside a session. The operator commands -SET ARCHIVE, -SET LOG, and -SET SYSPARM are completely different: they change how this DB2 for z/OS member writes logs, mounts archive tapes, and which subsystem parameter module is active—without always requiring a recycle. This page covers those three commands, every documented option, and when the change is temporary versus written into the BSDS.
Beginners mix these up constantly. SET CURRENT SCHEMA is SQL. -SET LOG SUSPEND is an operator command you type with the subsystem prefix from SDSF, a DSN session, DB2I COMMANDS, IMS/CICS, or IFI. Abbreviations: -SET ARC for SET ARCHIVE. All three SET commands have member data sharing scope: they affect the member whose prefix you used.
| Command | Purpose | How long it lasts |
|---|---|---|
| -SET ARCHIVE | Max tape units for archive read, and idle deallocation time | Until restart |
| -SET LOG (CHKTIME/LOGLOAD/SINGLE/BOTH) | Checkpoint frequency | Until restart (or next SET SYSPARM) |
| -SET LOG SUSPEND/RESUME | Freeze logging and updates for a consistent copy window | Until RESUME or STOP DB2 |
| -SET LOG NEWLOG/REMOVELOG | Add or remove an active log data set without recycling Db2 | Pervasive (BSDS) |
| -SET SYSPARM | Load online-updatable subsystem parameters | Until restart, another LOAD, RELOAD, or STARTUP |
-SET ARCHIVE sets the maximum number of tape units dedicated to reading archive logs, and how long an allocated archive-read tape may sit idle before z/OS deallocates it. It overrides the installation values (READ TAPE UNITS / COUNT and DEALLOC PERIOD / TIME) until Db2 restarts. Authorization: ARCHIVE privilege, SYSOPR, SYSCTRL, or SYSADM.
Maximum tape units for concurrent archive reads: 1 to 99. Raising COUNT allows more concurrent unique archive tape data sets. Lowering COUNT deallocates inactive units immediately; tapes that are active or premounted stay allocated until they become inactive. If the operator replies CANCEL to IEF238D (device name or cancel), COUNT is reset to the number of units already obtained.
Restores COUNT and TIME to the values specified during Db2 installation.
For best archive-read performance, IBM suggests the largest COUNT and TIME your tape configuration can support. In data sharing, a tape kept allocated on one member is unavailable to other members. If recover jobs run on different members, you often want DEALLOC PERIOD of 0 and you may avoid a large COUNT so tapes free quickly.
1234-SET ARCHIVE COUNT(2) TIME(,30) -SET ARCHIVE COUNT(4) TIME(2) -SET ARCHIVE COUNT(1) TIME(1440) -SET ARCHIVE DEFAULT
Responses include messages in the DSNJ334I–DSNJ337I range confirming the new count and time.
-SET LOG changes checkpoint frequency, suspends or resumes logging and updates, and can add (or, in current releases, remove) an active log data set. Checkpoint and suspend/resume changes are temporary across restart (LOGLOAD takes effect after the next system checkpoint). NEWLOG / REMOVELOG changes are pervasive because they update the BSDS. Same ARCHIVE / SYSOPR / SYSCTRL / SYSADM authorization as SET ARCHIVE.
A very large interval can make restart after an abend slow because Db2 must process more log. A very small interval causes excessive checkpoints. LOGLOAD(0) / CHKTIME(0) is synchronous from a batch job and asynchronous from a console. In data sharing, avoid requesting that immediate checkpoint while any member has SET LOG SUSPEND—the checkpoint can wait until RESUME. DISPLAY LOG shows whether CHKTIME, LOGLOAD, or both are in use. After restart, checkpoint values return to the subsystem parameter (or whatever SET SYSPARM last loaded).
SUSPEND externalizes unwritten log buffers, takes a system checkpoint in non-data-sharing, updates the BSDS with the high-written RBA, then suspends update activity. Message DSNJ372I stays on the console until resume. Writes of 32 KB pages and data set extensions for all page sizes are quiesced so a volume copy does not capture a torn 32 KB page or a VSAM catalog that disagrees with the data set. Read-only activity can continue. Update activity stays suspended until SET LOG RESUME or STOP DB2.
SUSPEND is not allowed when ARCHIVE LOG or STOP DB2 is already running a system quiesce. While suspended, do not issue ARCHIVE LOG unless you also specify CANCEL OFFLOAD. Do not keep logging suspended during high activity or for a long time—lock timeouts and diagnostic dumps are common side effects. The copy taken between SUSPEND and RESUME can contain uncommitted data; restoring that copy and restarting Db2 lets restart recovery make the subsystem consistent.
Issue RESUME from a z/OS console or the installation SYSADM ID. While the log-write latch is held, command-authorization checking from other paths can hang until logging resumes. In data sharing: SUSPEND on one member, wait until it completes, then SUSPEND the remaining members.
NEWLOG(data-set-name) adds a newly defined active log to the BSDS inventory if Db2 can open it. It is available immediately—no recycle. Define the VSAM linear data set with IDCAMS first. IBM recommends formatting with DSNJLOGF before NEWLOG. COPY(1|2) identifies copy 1 or copy 2; in dual logging, add both copies. Current Db2 releases also support REMOVELOG to delete an active log data set from the BSDS when you have drained that log and no longer need it in the inventory.
12345678-SET LOG LOGLOAD(0) -SET LOG LOGLOAD(150000) -SET LOG BOTH CHKTIME(10) LOGLOAD(500000) -SET LOG SINGLE LOGLOAD(500000) -SET LOG SUSPEND -SET LOG RESUME -SET LOG NEWLOG(DSNC910.LOGCOPY1.DS04) COPY(1) -SET LOG NEWLOG(DSNC910.LOGCOPY2.DS04) COPY(2)
-SET SYSPARM loads a subsystem parameter (ZPARM) module while Db2 is up, changing parameters that are defined as online updatable. Member scope.
| Privilege | What you can change |
|---|---|
| SYSOPR, SYSCTRL, SYSADM, SECADM | Issue SET SYSPARM for ordinary online-updatable parameters |
| Installation SYSADM or SECADM | Change SYSADM1/2, SYSOPR1/2, SECADM1/2, SECADM*_TYPE, SEPARATE_SECURITY, REVOKE_DEP_PRIVILEGES, AUTHCACH, BINDNV, DBACRVW, EXTSEC, TCPALVER |
Typical workflow: DSNTINST in Update mode, assemble/link the new module, ensure LLA has refreshed if the data set is in the LNKLST (F LLA,REFRESH after compressing a library), then SET SYSPARM. Do not issue SET SYSPARM while ARM is compressing the data set that contains the new module. If you are not authorized for installation SYSADM/SECADM parameters, Db2 keeps the previous values for those keywords and issues DSNZ015I for each unauthorized attempt.
123-SET SYSPARM LOAD(ADMPARM1) -SET SYSPARM RELOAD -SET SYSPARM STARTUP
SET ARCHIVE is telling the librarian how many tape cassette players may stay plugged in, and how long a player can sit unused before you unplug it. SET LOG is adjusting how often Db2 writes a bookmark in its diary (checkpoints), or pressing pause on the diary so you can photocopy every page without a page turning mid-copy. SET SYSPARM is swapping the rule book Db2 is using while the library stays open—but only the pages that are allowed to change without closing the building.
1. Do -SET ARCHIVE changes survive a Db2 restart?
2. What does -SET LOG SUSPEND do?
3. What is the difference between SET LOG SINGLE and BOTH?
4. Which SET SYSPARM option restores the parameters Db2 had at startup?
5. Why format a new active log with DSNJLOGF before SET LOG NEWLOG?