IBM Support

PH30610: NEW FUNCTION SUPPORT FOR LOAD DEFAULTIF <> (NOT EQUAL) AND LOAD DEFAULTIF ERROR.

A fix is available

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as new function.

Error description

  • New Function for the LOAD utility
    1. LOAD DEFAULTIF(X<>Y) to compare a field or position to a
    constant value.
    2. LOAD DEFAULTIF(ERROR) for conversion errors.
    

Local fix

Problem summary

  • ****************************************************************
    * USERS AFFECTED:                                              *
    * All Db2 12 for z/OS users of the LOAD                        *
    * DEFAULTIF utility.                                           *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    * New function support for the LOAD                            *
    * utility. This APAR will add two new                          *
    * DEFAULTIF conditions, not equal (<>)                         *
    * and conversion error.                                        *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    In LOAD utility statements, a default value can be loaded into
    a column by specifying the DEFAULTIF clause. Prior to this
    APAR, the only condition that could be specified for DEFAULTIF
    is an "equal to" (=) comparison.
    For example:
    LOAD ... COL2 POSITIONS(5:10) CHAR(6) DEFAULTIF(COL1='ABC')
    In this case, if COL1 equals ABC, the default column value is
    loaded into COL2.
    With this APAR, two new conditions are added for the DEFAULTIF
    clause - '<>' for not equal and 'CONV_ERROR' for conversion
    error. The following condtions can now be specified:
    A default column value is loaded if a conversion error occurs.
    For example:
    COL2 POSITION(5:14)DATE DEFAULTIF(CONV_ERROR)
    The new CONV_ERROR keyword indicates that if a conversion error
    occurs when loading the column value, the default column value
    is to be used instead.
    A default column value is loaded if a field does not equal (<>)
    a particular value.
    For example:
    COL2 POSITION(5:10) CHAR(6) DEFAULTIF(COL1<>'ABC')
    The new <> specification indicates that if COL1 does not equal
    ABC, the default value is loaded into COL2.
    Similarly, the following example specifies that if the value
    from position 5 to position 10 does not equal ABCDE, the
    default value is loaded into COL2:
    COL2 POSITION(5:10) CHAR(6) DEFAULTIF((5:9) <> 'ABCDE')
    

Problem conclusion

Temporary fix

Comments

  • LOAD DEFAULTIF utility code in Db2 is modified to support the
    not equal comparator. LOAD DEFAULTIF can now also take the
    default value for conversion errors. In the scenario that a
    conversion error is detected, the system will no longer issue
    a conversion error message.
    PH30610 introduces the following changes to externals. The
    LOAD utility DEFAULTIF description is modified to include the
    CONV_ERROR keyword and support the <> comparator.
    >>-+------------------CONV_ERROR-----------------------+---><
       +-field-name--------+--+-=--+--+-X'byte-string'-----+
       '-(start-+------+-)-'  '-<>-'  +-'character-string'-+
                '-:end-'              +-G'graphic-string'--+
                                      '-N'graphic-string'--'
    DEFAULTIF defaultif-condition
    Specifies that the field (identified in the
    field-specification) is to be loaded with the default column
    value if the specified condition is true.
    defaultif-condition
    The condition that is evaluated.
    Within this condition, specify any character-string constants
    in the same character set as the input data record. For
    example, specify EBCDIC constants if your data is in EBCDIC
    and specify UNICODE constants if your data is in UNICODE.
    You can also code the DEFAULTIF condition using the
    hexadecimal form. For example, if the input data is in EBCDIC
    and the control statement is in UTF-8, use (1:1)=X'31' in the
    condition rather than (1:1)='1'
    If you use DEFAULTIF with the ROWID keyword, and the
    condition is met, the column is loaded with a value that Db2
    generates.
    You cannot specify DEFAULTIF for XML columns.
    CONV_ERROR
    Specifies that the condition is a conversion error. If a
    conversion error occurs, the default value is loaded.
    field-name
    The name of the field to be compared with a constant value.
    You must specify the name of a field that is defined in the
    field-specification. If field-name is used, the start and end
    positions of the field are given by the POSITION option of
    the field specification.
    The field that you specify must meet all of the following
    requirements:
         Contain a character or graphic string. No data type
         conversions are performed when the contents of the
         field in the input record are compared to a string
         constant.
         Start at the same byte offset in each assembled input
         record. If any record contains varying-length strings,
         which are stored with length fields, that precede the
         selection field, they must be padded so that the start
         of the selection field is always at the same offset.
    The field and the constant do not need to be the same
    length. If they are not, the shorter of the two is padded
    before a comparison is made. Character and graphic strings
    are padded with blanks. Hexadecimal strings are padded with
    zeros.
    If this field is a VARCHAR or VARGRAPHIC field, Db2 takes the
    length of the field from the 2-byte binary field before the
    data portion of the VARCHAR or VARGRAPHIC field.
    
    (start:end)
    Identifies column numbers in the assembled load record to use
    for the comparison in the DEFAULTIF condition. The first
    column of the record is column 1. The two numbers indicate
    the starting and ending columns of a selection field in the
    load record.
    If end is not used, the field is assumed to have the same
    length as the constant.
    = <>
    Specifies the type of comparison between the field
    (field-name or start:end) and constant (X'byte-string',
    'character-string', G'graphic-string', or
    N'graphic-string').
    
    =
    Equal to
    
    <>
    Not equal to
    X'byte-string'
    A string of hexadecimal characters. For example, the
    following condition specifies that the default value is to
    be loaded if the record has the value X'FFFF' in columns 33
    through 34.
    (33:34) = X'FFFF'
    
    'character-string'
    A string of characters. For example, the following clause
    specifies that the default value is to be loaded if the
    field DEPTNO has the value D11.
    DEPTNO = 'D11'
    If the field uses a specific external date, time, or
    timestamp format, the field specification must use a
    character string that matches the specified format.
    G'graphic-string'
    A string of double-byte characters. For example, the
    following clause specifies that the default is to be loaded
    if the record has the specified value in columns 33 through
    36.
    (33:36) = G'<**>'
    In this example, < is the shift-out character, * is a
    double-byte character, and > is the shift-in character.
    If the first or last byte of the input data is a shift-out
    character, it is ignored in the comparison. Specify G as an
    uppercase character.
    N'graphic-string'
    A string of double-byte characters. N and G are synonymous
    for specifying graphic string constants. Specify N as an
    uppercase character.
    IBM Knowledge Center is updated for this change:
    http://www.ibm.com/support/knowledgecenter/SSEPEK_12.0.0
    

APAR Information

  • APAR number

    PH30610

  • Reported component name

    DB2 OS/390 & Z/

  • Reported component ID

    5740XYR00

  • Reported release

    C10

  • Status

    CLOSED UR1

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2020-10-15

  • Closed date

    2021-01-06

  • Last modified date

    2021-02-01

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

    UI73338

Modules/Macros

  • DSNURPNL DSNURWBG DSNUGPRW DSNUGPPF DSNUGUCA DSNUGPRS DSNURWUF
    

Fix information

  • Fixed component name

    DB2 OS/390 & Z/

  • Fixed component ID

    5740XYR00

Applicable component levels

  • RC10 PSY UI73338

       UP21/01/14 P F101

Fix is available

  • Select the PTF appropriate for your component level. You will be required to sign in. Distribution on physical media is not available in all countries.

[{"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Product":{"code":"SG19M","label":"APARs - z\/OS environment"},"Platform":[{"code":"PF054","label":"z\/OS"}],"Version":"12.0"}]

Document Information

Modified date:
02 February 2021