+ Reply to Thread
Results 1 to 7 of 7

Thread: Reading data queue containing a zoned decimal field

  1. #1
    Guest.Visitor Guest

    Default Reading data queue containing a zoned decimal field

    Mark Lawther wrote: > The new field is defined in the OPEN DATAQUEUE statement as DEC(3,0) > (see snippets below). I now receive the error "Runtime error > '-2147217887 (80040e21) Multiple-step OLE DB operation generated > errors." Looking at the DQ's record set in VB debug, I can see the > new field contains the error. Also, the next field in the record set > is shifted left 1 byte. I have verified the DQ definition on the > AS/400 matches the VB definition. The AS/400 field is zoned, not > packed. Mark, I believe that the Decimal data type is most likely packed. To solve this, I'd either define dqEdsNo as 5.0 p or 3.0p and shift everything one down (which you could make easier on yourself by defining the lengths only and not using the from and to designators). Bill

  2. #2
    Guest.Visitor Guest

    Default Reading data queue containing a zoned decimal field

    Bill, Thanks for your reply. That idea made sense but I still get the same error. I changed the D spec as you suggested (see snippet) and, just to make sure, I recreated the dq and recompiled the VB too. Any other ideas? Mark
    Code

  3. #3

    Default Reading data queue containing a zoned decimal field

    If you've got the TAA Toolkit, place a few entries on the Queue and then try DSPDTAQ to get a feel for what the Data actually looks like. Maybe that will help you figure out what's wrong. Copy and Paste it to your next Post.... I'd be interested to see what the numeric field looks like.

  4. #4
    Guest.Visitor Guest

    Default Reading data queue containing a zoned decimal field

    I have a VB program that reads from a data queue. It has been working well but new functionality requires me to add a zoned decimal field. The new field is defined in the OPEN DATAQUEUE statement as DEC(3,0) (see snippets below). I now receive the error "Runtime error '-2147217887 (80040e21) Multiple-step OLE DB operation generated errors." Looking at the DQ's record set in VB debug, I can see the new field contains the error. Also, the next field in the record set is shifted left 1 byte. I have verified the DQ definition on the AS/400 matches the VB definition. The AS/400 field is zoned, not packed. Using CA Express ADO/DB driver, latest service pack installed. OS/400 V4R5. What am I missing? Thanks in advance, Mark
    Code

  5. #5
    Guest.Visitor Guest

    Default Reading data queue containing a zoned decimal field

    Bill, Your solution did work. Apparently the server job (QZDASOINIT) had a lock on the original RPG pgm and it kept running the old object even after it had been recompiled. Once my server job timed out and the pgm was replaced everything worked great. Thanks for your help, Mark

  6. #6
    Guest.Visitor Guest

    Default Reading data queue containing a zoned decimal field

    Mark Lawther wrote: > That idea made sense but I still get the same error. I changed the D > spec as you suggested (see snippet) and, just to make sure, I > recreated the dq and recompiled the VB too. Any other ideas? So, when you look at the variables in VB Debug, the field values are still shifted one left? Mike's suggestion about looking at the data in the queue might be worth pursuing. If you don't have a tool to view the data, I believe DmpObj can be used. Bill

  7. #7
    Guest.Visitor Guest

    Default Reading data queue containing a zoned decimal field

    Mark Lawther wrote: > Your solution did work. Apparently the server job (QZDASOINIT) had a > lock on the original RPG pgm and it kept running the old object even > after it had been recompiled. Once my server job timed out and the > pgm was replaced everything worked great. Glad to hear it. Bill

+ Reply to Thread

Similar Threads

  1. Reading HEX and converting to decimal
    By J.Wells in forum RPG
    Replies: 23
    Last Post: 11-02-2006, 06:32 AM
  2. How to identify field holding invalid decimal data
    By Guest.Visitor in forum General
    Replies: 5
    Last Post: 07-18-2005, 05:26 AM
  3. Decimal vs Zoned fields in RPGLE
    By Guest.Visitor in forum RPG
    Replies: 1
    Last Post: 01-24-2002, 08:32 AM
  4. Replies: 4
    Last Post: 01-22-2001, 10:59 AM
  5. Zoned Decimal array in RPG III
    By Guest.Visitor in forum Application Software
    Replies: 5
    Last Post: 07-28-2000, 12:40 PM

Posting Permissions

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