Job DSNTEJ2U

DSNTEJ2U prepares and tests several sample user-defined functions and a driver program that exercises the user-defined functions.

In order for the installation CLIST to generate job DSNTEJ2U, you must complete the following steps during installation:
  • Specify that the host has access to C/C++ for z/OS® on installation panel DSNTIPU.
  • Specify the name of the default WLM environment on installation panel DSNTIPX.

The sample user-defined functions are:

Function
Description
ALTDATE
Returns the current date in a user-specified format or converts a user-specified date from one format to another.
ALTTIME
Returns the current time in a user-specified format or converts a user-specified time from one format to another.
CURRENCY
Formats a floating point number as a currency value.
DAYNAME
Returns the day of the week for a user-specified date in ISO format.
MONTHNAME
Returns the month for a user-specified date in ISO format.
TABLE_LOCATION
Returns the location name of a table, view, or undefined object found after resolving aliases for a user-specified object.
TABLE_NAME
Returns the name of a table, view, or undefined object found after resolving aliases for a user-specified object.
TABLE_SCHEMA
Returns the schema name of a table, view, or undefined object found after resolving aliases for a user-specified object.
WEATHER
Returns sample weather data obtained from a TSO data set by way of demonstrating the usefulness of a user-defined function table function.

If you do not have C++ installed, skip steps PH02US08 and PH02US09. Also remove all statements that refer to DAYNAME and MONTHNAME from part DSNTESU in the prefix.SDSNSAMP library.

Job DSNTEJ2U consists of the steps that are listed in the table below.

Table 1. Steps in job DSNTEJ2U
Step Function
1 Drops all specific sample user-defined functions.
2 Creates and registers all sample user-defined functions. Grants EXECUTE authority to PUBLIC for the sample user-defined functions.
3-10 Prepares the eight external programs used by specific user-defined functions.
11 Binds the package for the TABLE_NAME, TABLE_SCHEMA, and TABLE_LOCATION functions. These are the only sample functions that issue SQL statements. This step also grants EXECUTE authority on these two samples to PUBLIC.
12 Invokes DSNTEP2 to exercise the sample user-defined functions.
13 Prepares DSN8DUWF, the external module for the sample user defined table function, WEATHER.
14 Prepares DSN8DUWC, a sample client function for statically invoking the WEATHER user-defined table function.
15 Binds the package and plan for DSN8DUWC and grants the necessary authorities.
16 Invokes DSN8DUWC.

If DSNTEJ2U runs successfully, it produces the return codes that are shown in the table below.

Table 2. DSNTEJ2U return codes
Step PROCSTEP Return code
PHO2US01   0000
PH02US02   0000 or 0004
PH02US03 - PH02US07
PC
C
PLKED1
LKED
0004
0000
0004
0000
PH02US08 - PH02US09
PC
CP
PLKED2
LKED
0004
0000
0004
0000
PH02US10
PC
C
PLKED1
LKED
0000
0000
0004
0000
PH02US11   0000
PH02US12   0004
PH02US13
PC
C
PLKED1
LKED
0004
0000
0004
0000
PH02US14
PC
C
PLKED1
LKED
0000
0000
0004
0000
PH02US15   0000 or 0004
PH02US16   0000
Notes:
  1. The PLKED step does not exist in the job if the value of the CPP LE PRELINKER PHASE field is set to NO.

You can compare the output from this job with the sample output for DSNTEJ2U found in member DSN8TJ2U in your prefix.SDSNIVPD data set.