Db2 productivity-aid sample programs

Db2 provides four sample programs that many users find helpful as productivity aids. These programs are shipped as source code, so you can modify them to meet your needs.

DSNTIAUL
DSNTIAUL is a sample program for unloading data, as an alternative to the UNLOAD utility. DSNTIAUL is written in the assembler language. DSNTIAUL can unload some or all rows from up to 100 Db2 tables. With DSNTIAUL, you can unload data of any Db2 built-in data type or distinct type. DSNTIAUL unloads the rows in a form that is compatible with the LOAD utility and generates utility control statements for LOAD. You can also used DSNTIAUL to execute any SQL non-SELECT statement that can be executed dynamically.
DSNTIAD
The DSNTIAD sample program can issue any SQL statement that can be executed dynamically, except for SELECT statements. DSNTIAD is written in assembler language.
DSNTEP2
DSNTEP2 is a sample dynamic SQL program that can issue any SQL statement that can be executed dynamically. DSNTEP2 is written in PL/I language and available in two versions: a source version that you can modify to meet your needs or an object code version that you can use without the need for a PL/I compiler.
DSNTEP4
The DSNTEP4 sample program is identical to DSNTEP2, except that it uses multi-row fetch for increased performance. DSNTEP4 is written in PL/I language and available in two versions: a source version that you can modify to meet your needs or an object code version that you can use without the need for a PL/I compiler.

Because these four programs also accept the static SQL statements CONNECT, SET CONNECTION, and RELEASE, you can use the programs to access Db2 tables at remote locations.

Preparing the productivity-aid sample programs

DSNTIAUL and DSNTIAD are shipped only as source code, so you must precompile, assemble, link, and bind them before you can use them. If you want to use the source code version of DSNTEP2 or DSNTEP4, you must precompile, compile, link, and bind it. You need to bind the object code version of DSNTEP2 or DSNTEP4 before you can use them. Usually a system administrator prepares the programs as part of the installation process.

Important: Start of changeAlways bind the package for the DSNTIAUL sample program with the REOPT(ALWAYS) bind option, and do not specify the CONCENTRATESTMT(YES) bind option for this package.End of change

The following table indicates the installation jobs that prepare each sample program. All installation jobs are in data set DSN1310.SDSNSAMP.

Table 1. Jobs that prepare DSNTIAUL, DSNTIAD, DSNTEP2, and DSNTEP4
Program name Program preparation job
DSNTIAUL DSNTEJ2A
DSNTIAD DSNTIJTM
DSNTEP2 (source) DSNTEJ1P
DSNTEP2 (object) DSNTEJ1L
DSNTEP4 (source) DSNTEJ1P
DSNTEP4 (object) DSNTEJ1L

Application compatibility for the productivity-aid sample programs

If you are ready for the productivity-aid sample programs to start using new application capabilities in later Db2 13 function levels, you must rebind the packages for these programs with the corresponding APPLCOMPAT option.

Start of changeThe Db2 13 jobs for preparing the productivity-aid sample programs bind the packages with the following APPLCOMPAT Settings:End of change

Start of change
CLIST run APPLCOMPAT setting used
Installing Db2 13 DSNTIP00 TARGET FUNCTION LEVEL (V13R1M501)
Classic migration V13R1M501
z/OSMF migration DSNTIP00 TARGET FUNCTION LEVEL (such as V13R1M501 or V13R1M500)
End of change

For more information, see Controlling the Db2 application compatibility level and Function levels and related levels in Db2 13.

Running the productivity-aid sample programs

To run the sample programs, use the RUN (DSN) command. For more information, see RUN subcommand (DSN) and the following topics.

Retrieval of UTF-16 Unicode data by DSNTEP2, DSNTEP4, and DSNTIAUL

You can use DSNTEP2, DSNTEP4, and DSNTIAUL to retrieve Unicode UTF-16 graphic data. However, these programs might not be able to display some characters, if those characters have no mapping in the target SBCS EBCDIC CCSID.