Update, case, and -407

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • MeBuggyYouJane

    Update, case, and -407

    The following (skeleton) works fine when using AQT (win/xp, ODBC),
    but throws a -407 when issued from green screen SPUFI. The DB is 8.1.5
    on z/OS.

    update tableFoo
    set colFoo =
    case
    when otherFoo = 'A' then 'B'
    when otherFoo = 'C' then 'D'
    end

    Any notion why? Couldn't find an APAR or any explanation on
    the DB2 site.

    thx
  • MeBuggyYouJane

    #2
    Re: Update, case, and -407

    MeBuggyYouJane wrote:
    The following (skeleton) works fine when using AQT (win/xp, ODBC),
    but throws a -407 when issued from green screen SPUFI. The DB is 8.1.5
    on z/OS.
    >
    update tableFoo
    set colFoo =
    case
    when otherFoo = 'A' then 'B'
    when otherFoo = 'C' then 'D'
    end
    >
    Any notion why? Couldn't find an APAR or any explanation on
    the DB2 site.
    >
    thx
    Forgot: the win/xp machine has 8.2.9 ESE and the attendant ODBC driver,
    I'm not in CubeLand, so don't have the version number.

    Comment

    • Serge Rielau

      #3
      Re: Update, case, and -407

      MeBuggyYouJane wrote:
      MeBuggyYouJane wrote:
      >The following (skeleton) works fine when using AQT (win/xp, ODBC),
      >but throws a -407 when issued from green screen SPUFI. The DB is 8.1.5
      >on z/OS.
      >>
      >update tableFoo
      >set colFoo =
      >case
      > when otherFoo = 'A' then 'B'
      > when otherFoo = 'C' then 'D'
      >end
      >>
      >Any notion why? Couldn't find an APAR or any explanation on
      >the DB2 site.
      >>
      >thx
      >
      Forgot: the win/xp machine has 8.2.9 ESE and the attendant ODBC driver,
      I'm not in CubeLand, so don't have the version number.
      Keep in mind that there is an implied ELSE NULL in the CASE expression.
      So the question is: Why do you hit the ELSE in DB2 for zOS and not on
      DB2 for LUW.
      Two choices:
      * Different data
      * Some difference in the WHERE clause you haven't shown us

      My money is on the data. You got some 'bad' "OTHERFOO" on DB2 for zOS

      Cheers
      Serge


      --
      Serge Rielau
      DB2 Solutions Development
      IBM Toronto Lab

      Comment

      • MeBuggyYouJane

        #4
        Re: Update, case, and -407

        Serge Rielau wrote:
        MeBuggyYouJane wrote:
        >MeBuggyYouJa ne wrote:
        >>The following (skeleton) works fine when using AQT (win/xp, ODBC),
        >>but throws a -407 when issued from green screen SPUFI. The DB is 8.1.5
        >>on z/OS.
        >>>
        >>update tableFoo
        >>set colFoo =
        >>case
        >> when otherFoo = 'A' then 'B'
        >> when otherFoo = 'C' then 'D'
        >>end
        >>>
        >>Any notion why? Couldn't find an APAR or any explanation on
        >>the DB2 site.
        >>>
        >>thx
        >>
        >Forgot: the win/xp machine has 8.2.9 ESE and the attendant ODBC driver,
        >I'm not in CubeLand, so don't have the version number.
        Keep in mind that there is an implied ELSE NULL in the CASE expression.
        So the question is: Why do you hit the ELSE in DB2 for zOS and not on
        DB2 for LUW.
        Two choices:
        * Different data
        * Some difference in the WHERE clause you haven't shown us
        >
        My money is on the data. You got some 'bad' "OTHERFOO" on DB2 for zOS
        >
        Cheers
        Serge
        >
        >
        The moral of the story: don't trust COBOL/SPUFI coders. Either the
        emulator or SPUFI has a "caps on" option, which re-writes quoted strings
        too. So a

        when otherFoo = 'SomeValue'

        becomes

        when otherFoo = 'SOMEVALUE'

        and the -407 makes lots of sense.

        :)

        Comment

        • Frank Swarbrick

          #5
          Re: Update, case, and -407

          By default mainframe editors usually convert everything to uppercase...
          (Not to say this is good. It's simply true.)

          n 6/4/2008 at 5:35 PM, in message
          <iuSdnQl124AEu9 rVnZ2dnUVZ_uCdn Z2d@rcn.net>, MeBuggyYouJane< gnuoytr@rcn.com >
          wrote:
          Serge Rielau wrote:
          >MeBuggyYouJa ne wrote:
          >>MeBuggyYouJan e wrote:
          >>>The following (skeleton) works fine when using AQT (win/xp, ODBC),
          >>>but throws a -407 when issued from green screen SPUFI. The DB is
          8.1.5
          >>>on z/OS.
          >>>>
          >>>update tableFoo
          >>>set colFoo =
          >>>case
          >>> when otherFoo = 'A' then 'B'
          >>> when otherFoo = 'C' then 'D'
          >>>end
          >>>>
          >>>Any notion why? Couldn't find an APAR or any explanation on
          >>>the DB2 site.
          >>>>
          >>>thx
          >>>
          >>Forgot: the win/xp machine has 8.2.9 ESE and the attendant ODBC
          driver,
          >>I'm not in CubeLand, so don't have the version number.
          >Keep in mind that there is an implied ELSE NULL in the CASE expression.
          >So the question is: Why do you hit the ELSE in DB2 for zOS and not on
          >DB2 for LUW.
          >Two choices:
          >* Different data
          >* Some difference in the WHERE clause you haven't shown us
          >>
          >My money is on the data. You got some 'bad' "OTHERFOO" on DB2 for zOS
          >>
          >Cheers
          >Serge
          >>
          >>
          The moral of the story: don't trust COBOL/SPUFI coders. Either the
          emulator or SPUFI has a "caps on" option, which re-writes quoted strings
          too. So a
          >
          when otherFoo = 'SomeValue'
          >
          becomes
          >
          when otherFoo = 'SOMEVALUE'
          >
          and the -407 makes lots of sense.
          >
          :)

          Comment

          Working...