Running a program in TSO foreground

Use the DB2I RUN panel to run a program in TSO foreground. Alternatively, you can issue the DSN command, followed by the RUN subcommand of DSN.

About this task

Before running the program, be sure to allocate any data sets that your program needs.

The following example shows how to start a TSO foreground application. The name of the application is SAMPPGM, and ssid is the system ID:
TSO Prompt:    READY
Enter:         DSN SYSTEM(ssid)
DSN Prompt:    DSN
Enter:         RUN PROGRAM(SAMPPGM) -
               PLAN(SAMPLAN) -
               LIB(SAMPPROJ.SAMPLIB) -
               PARMS('/D01 D02 D03')
⋮ (Here the program runs and might prompt you for input)
DSN Prompt:    DSN
Enter:         END
TSO Prompt:    READY

This sequence also works in ISPF option 6. You can package this sequence in a CLIST. Db2 does not support access to multiple Db2 subsystems from a single address space.

The PARMS keyword of the RUN subcommand enables you to pass parameters to the run time processor and to your application program:
PARMS ('/D01, D02, D03')
The slash (/) indicates that you are passing parameters. For some languages, you pass parameters and run time options in the form PARMS('parameters/run time-options). An example of the PARMS keyword might be:
PARMS ('D01, D02, D03/')
Check your host language publications for the correct form of the PARMS option.