Let's understand Mainframe
Home Tutorials Interview Q&A Quiz Mainframe Memes Contact us About us

Module 12: DBRM, Package, Plan and DB2 JCL


DSN Command

DSN is the DB2 command processor. Every BIND, REBIND, FREE and RUN you do in batch is a DSN subcommand.

What the DSN command is

  • DSN is the DB2 command processor that runs under TSO.
  • In batch it runs inside an IKJEFT01 step. Interactively, you type DSN at the TSO READY prompt.
  • Each DB2 action, BIND, REBIND, FREE, RUN, is a subcommand typed after DSN starts.
  • The session ends with the END subcommand.

DSN SYSTEM syntax

  • DSN SYSTEM(subsystem-id) starts the DB2 session. The subsystem id (for example DB2A) comes from your DBA.
  • All subcommands run against that subsystem until you code END.
  • One SYSTSIN step can hold several DSN sessions, but each must be closed with its own END.

Common DSN subcommands

  • BIND PACKAGE / BIND PLAN - create packages and plans from DBRMs.
  • REBIND PACKAGE / REBIND PLAN - refresh existing packages and plans.
  • FREE PACKAGE / FREE PLAN - delete packages and plans you no longer need.
  • RUN PROGRAM - execute a DB2 program under a plan in batch.
  • DCLGEN - generate COBOL host-variable declarations from a table definition.

Example: DSN RUN in SYSTSIN

  • These SYSTSIN cards start a DB2 session and run program EMPUPDT under plan EMPPLAN:
    //SYSTSIN DD * DSN SYSTEM(DB2A) RUN PROGRAM (EMPUPDT) PLAN (EMPPLAN) LIB ('USERID.LOADLIB') END /*





© copyright mainframebug.com
Privacy Policy
MainframeBug Assistant