DSN command processor

The DSN command processor is a TSO command processor that runs in TSO foreground or under TSO in a JES-initiated batch environment.

It uses the TSO attachment facility to access DB2®. The DSN command processor provides an alternative method for running programs that access DB2 in a TSO environment.

When you run an application by using the DSN command processor, that application can run in a trusted connection if DB2 finds a matching trusted context.

You can use the DSN command processor implicitly during program development for functions such as:
  • Using the declarations generator (DCLGEN)
  • Running the BIND, REBIND, and FREE subcommands on DB2 plans and packages for your program
  • Using SPUFI (SQL Processor Using File Input) to test some of the SQL functions in the program

The DSN command processor runs with the TSO terminal monitor program (TMP). Because the TMP runs in either foreground or background, DSN applications run interactively or as batch jobs.

The DSN command processor can provide these services to a program that runs under it:
  • Automatic connection to DB2
  • Attention key support
  • Translation of return codes into error messages

Limitations of the DSN command processor

When using DSN services, your application runs under the control of DSN. Because TSO executes the ATTACH macro to start DSN, and DSN executes the ATTACH macro to start a part of itself, your application gains control that is two task levels below TSO.

Because your program depends on DSN to manage your connection to DB2:
  • If DB2 is down, your application cannot begin to run.
  • If DB2 terminates, your application also terminates.
  • An application can use only one plan.

If these limitations are too severe, consider having your application use the call attachment facility or Resource Recovery Services attachment facility. For more information about these attachment facilities, see Call attachment facility and Resource Recovery Services attachment facility.

DSN return code processing

At the end of a DSN session, register 15 contains the highest value that is placed there by any DSN subcommand that is used in the session or by any program that is run by the RUN subcommand. Your run time environment might format that value as a return code. However, the value does not originate in DSN.