IBM Support

PK89029: SQL -302 when inserting a SQL variable length column

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • SQL -302 is received when the following EGL generated code is ex
    ecuted.
    
    EXEC SQL
         insert into JFba7200  (COUNTRY_CODE, SUBSIDIARY_CODE,
    REVERSE_TIMESTAMP, SOURCE_ID_FROM, SOURCE_ID_TO, INTERF_TYPE,
    LINE_NUM, REC_TYPE, SEQ_NUM, CREATE_TIMESTAMP, VARSTRNG)
    values (
    :EZESQL-HOST-VARS.EZESQL-HST-20714
    :EZESQL-HOST-VARS.EZESQL-HST-20714-I,
    :EZESQL-HOST-VARS.EZESQL-HST-20716
    :EZESQL-HOST-VARS.EZESQL-HST-20716-I,
    :EZESQL-HOST-VARS.EZESQL-HST-20718
    :EZESQL-HOST-VARS.EZESQL-HST-20718-I,
    :EZESQL-HOST-VARS.EZESQL-HST-20720
    :EZESQL-HOST-VARS.EZESQL-HST-20720-I,
    :EZESQL-HOST-VARS.EZESQL-HST-20722
    :EZESQL-HOST-VARS.EZESQL-HST-20722-I,
    :EZESQL-HOST-VARS.EZESQL-HST-20724
    :EZESQL-HOST-VARS.EZESQL-HST-20724-I,
    :EZESQL-HOST-VARS.EZESQL-HST-20726
    :EZESQL-HOST-VARS.EZESQL-HST-20726-I,
    :EZESQL-HOST-VARS.EZESQL-HST-20728
    :EZESQL-HOST-VARS.EZESQL-HST-20728-I,
    :EZESQL-HOST-VARS.EZESQL-HST-20730
    :EZESQL-HOST-VARS.EZESQL-HST-20730-I, CURRENT TIMESTAMP,
    :EZESQL-HOST-VARS.EZESQL-HST-20732-V
    :EZESQL-HOST-VARS.EZESQL-HST-20732-I)
    END-EXEC
    
    MOVEMENT into highlighted var:
    
    MOVE VARSTRNG-1750 IN JFBR50R72A-1751 TO EZELFV-SQL-20731
    MOVE EZELFV-SQL-20731 TO EZESQL-HST-20732
    
    Declarations in COBOL:
    
    04  JFBR50R72A-1751.
        05  COUNTRY-CODE-1740-I PIC S9(4) COMP-4.
       .
              .
       .
        05  CREATE-TIMESTAMP-1749 PIC X(26).
        05  VARSTRNG-1750-I PIC S9(4) COMP-4.
        05  VARSTRNG-1750-V.
            49  VARSTRNG-1750-L PIC S9(4) COMP-4.
            49  VARSTRNG-1750 PIC X(1780).  --? Varying length upto
    1780
    
    
    
      03  EZELFV-SQL-20731 PIC X(1780).    --? FIXED length 1780
    
    
     02  EZESQL-HST-20732-I PIC S9(4) COMP-4.
     02  EZESQL-HST-20732-V.
         49  EZESQL-HST-20732-L PIC S9(4) COMP-4.
         49  EZESQL-HST-20732 PIC X(1780). --? Varying Length upto 1
    780
    
    Lets say, VARSTRNG-1750 IN JFBR50R72A-1751 as V1, EZELFV-SQL-207
    31 as V2 and EZESQL-HST-20732 as V3.
    
    Variable V1 is a varying length(level 49).
    Variable v2 is fixed length 1780.
    When V2 is moved to V3, V3 also picks up the length of V2.
    But since VARSTRNG column in JFBT72 is only 1750 bytes, this ins
    ert query abends with SQLCODE -302.
    
    Problem here is that here movement has happend like V1--? v2 --?
     v3.
    

Local fix

Problem summary

  • The problem was in the reading of the variable length sql
    field, and this invalid read eventually found its way to an
    add statement, which in turn caused the -302 error. The read
    problem was that a variable length sql variable was being
    read into a non-sql field, and the variable length was not
    being used in that circumstance, causing the residual data
    to be left intact.
    

Problem conclusion

  • Software updated. Fixtest available.
    

Temporary fix

Comments

APAR Information

  • APAR number

    PK89029

  • Reported component name

    RBD EGL FOR COB

  • Reported component ID

    5724S5001

  • Reported release

    751

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2009-06-16

  • Closed date

    2009-07-23

  • Last modified date

    2009-07-23

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

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

Fix information

  • Fixed component name

    RBD EGL FOR COB

  • Fixed component ID

    5724S5001

Applicable component levels

  • R751 PSN

       UP

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSMQ79","label":"Rational Business Developer"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"7.5.1","Line of Business":{"code":"LOB35","label":"Mainframe SW"}}]

Document Information

Modified date:
06 December 2021