CICS VSAM Transparency for z/OS, Version 1.2


NULLCOLS

This generic exit is for mapping fields to nullable DB2® columns. Optional user parameters specified in the mapping define the VSAM field values that are to become nulls in DB2. The default version of the exit handles the conversion of repeating bytes of binary zeros, binary ones, and spaces into nulls, and conversion to any of these values on retrieval from DB2.

Much of the function of this exit is superseded by the built-in support for nullable columns.

The exit must be mapped as follows:

EXITA=NULLCOLS,input,output
			

The parameter input defines the VSAM field value that is to become null in DB2. The parameter output defines the field value to be built by CICS® VT and returned to VSAM. The value you specify must be repeated in each byte for the entire field. Otherwise it is not treated as null.

Possible parameter values for inputare:
L
Low values (binary zeros)
S
Spaces
H
High values (binary ones)
1-5
User defined
The output parameter is optional. If omitted, it is assumed to be the same as the input parameter. Multiple input values can be specified if more than one VSAM field value is to become null. In this case, if no output parameter is specified, the exit assumes that the first input parameter represents the output parameter.

Example 1:

EXITA=NULLCOLS,S
An input field value of spaces becomes a null value in DB2. On retrieval from DB2, the field will be spaces.

Example 2:

EXITA=NULLCOLS,LS
An input field value of binary zeros or spaces become null in DB2. On retrieval, the field value becomes binary zeros.

Example 3:

EXITA=NULLCOLS
If no parameters are specified, the default is L. Binary zeros become null in DB2, and the retrieved field value is binary zeros.

Example 4:

EXITA=NULLCOLS,,S
No input parameter is supplied, so the default is L. Field values of binary zeros become nulls in DB2. On retrieval, the field value becomes spaces.

You can define up to five custom values to be handled as null bytes. This involves modifying the exit source and assembling a new load module. There are potentially 10 lines of assembler code near the start of the program to be modified.

SETNULL1     DC    X'6F'          /* INPUT PARAMETER VALUE 1
SETNULL2     DC    X'4B'          /* INPUT PARAMETER VALUE 2
SETNULL3     DC    X'60'          /* INPUT PARAMETER VALUE 3
SETNULL4     DC    X'00'          /* INPUT PARAMETER VALUE 4
SETNULL5     DC    X'00'          /* INPUT PARAMETER VALUE 5

FILLVAL1     DC    X'4B'          /* OUTPUT PARAMETER VALUE 1
FILLVAL2     DC    X'FF'          /* OUTPUT PARAMETER VALUE 2
FILLVAL3     DC    X'00'          /* OUTPUT PARAMETER VALUE 3
FILLVAL4     DC    X'00'          /* OUTPUT PARAMETER VALUE 4
FILLVAL5     DC    X'00'          /* OUTPUT PARAMETER VALUE 5

The SETNULLx fields define input parameters and the FILLVALn fields define output parameters. Custom value parameters can be combined with supplied parameter values.

Example 5:

EXITA=NULLCOLS,1SH
Input field values of X'6F', spaces, or binary ones become null values. No output parameter is specified, so the first input parameter value is used, resulting in field values x'6F' returned from DB2.

Example 6:

EXITA=NULLCOLS,1,2
VSAM field values of X'6F' become nulls, and are set to X'FF' on retrieval from DB2.


Concept topic


Last updated: May 25, 2012 20:46:1