Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2015
    Posts
    2

    Unanswered: Getting DSNH206I while compiling with IBMREQD

    Hi, first time posting here. Got a bizarre compiler error with a existence checking query giving: 'DSNH206I DSNHANAL LINE ## COL ## STATEMENT REFERENCES COLUMN "D1" . "IBMREQD", WHICH IS NOT DECLARED IN THE SPECIFIED TABLE(S).' and can't seem to find an answer. Platform is DB2 v10.1 on z/OS with Enterprise COBOL. Example query is:


    EXEC SQL
    SELECT 1
    FROM SYSIBM.SYSDUMMY1 AS D1
    WHERE EXISTS
    (SELECT 1
    FROM TA.TAT_TABLE1
    WHERE ( ( TRACKING_NUMBER = :TRACK-OR-BRIEF-NUMBER )
    AND ( ID_CODE = :ID-CODE )
    AND ( TYPE_P = 'REAL' )
    AND ( ENTERED_DATE >= :ENTERED-DATE )
    AND ( D1.IBMREQD = D1.IBMREQD ) ))
    OR EXISTS
    (SELECT 1
    FROM TA.TAT_TABLE1
    WHERE ( ( BRIEFING_CODE = :TRACK-OR-BRIEF-NUMBER )
    AND ( ID_CODE = :ID-CODE )
    AND ( TYPE_P = 'REAL' )
    AND ( ENTERED_DATE >= :ENTERED-DATE )
    AND ( D1.IBMREQD = D1.IBMREQD ) ))
    FETCH FIRST 1 ROWS ONLY
    END-EXEC.


    The query does work in SPUFI and QMF but can't seem to compile. Does anyone know of switch(s) to set or someone to talk to on getting something seen in almost all blogs to work?

  2. #2
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    the platform I presume is Z/os
    i believe D1.IBMREQD = D1.IBMREQD is always true
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

  3. #3
    Join Date
    Jul 2015
    Posts
    2
    Finally found my answer after searching two days for it. Again tried:


    EXEC SQL
    DECLARE SYSIBM.SYSDUMMY1 TABLE
    (IBMREQD CHAR(1) NOT NULL)
    END-EXEC.


    And the program compiled! Can only figured something got mistyped on the earlier go-around.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •