Midrange News for the IBM i Community


Posted by: neilrh
A/P
Jackson, MI
Resolved - OVRDBF and OPNQRYF broke
has no ratings.
Published: 17 Apr 2012
Revised: 23 Jan 2013 - 1707 days ago
Last viewed on: 26 Sep 2017 (5759 views) 

Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.

Resolved - OVRDBF and OPNQRYF broke Published by: neilrh on 17 Apr 2012 view comments(8)

We have a lot of programs that were written way back when dinosaurs roamed the earth.  At that time the preferred method for reading a subset in a file was to OVRDBF file SHARE(*YES), OPNQRYF file SELECT('some records'), CALL rpgpgm.  The RPG program would process the selected records found in the shared open datapath opened by the OPNQRYF.

As of today (for us V7.1) this appears to be broken.  I can only assume it was caused by a recent PTF - and unfortunately our Admin is away for the rest of this week, so we don't currently know what he installed last weekend.

Anyone else encountering this problem?

and yes I know I could rewrite this using SQL, but there's a lot of 20+ yo programs that are using this technique.

Return to midrangenews.com home page.
Sort Ascend | Descend

COMMENTS

(Sign in to Post a Comment)
Posted by: bobcozzi
Site Admin ****
Chicagoland
Comment on: Resolved - OVRDBF and OPNQRYF broke
Posted: 5 years 5 months 10 days 21 hours 51 minutes ago

I think I've seen this when the RPG program is running in a *NEW or NAMED activation group and the CL is CLP. When I changed the CLP attribute to CLLE and recompiled it seemed to fix it.

Posted by: DaleB
Premium member *
Reading, PA
Comment on: Resolved - OVRDBF and OPNQRYF broke
Posted: 5 years 5 months 10 days 21 hours 39 minutes ago

Bob is probably in the right vein. Called RPG in a different activation group than the calling CL? Another option is to change OVRDBF and DLTOVR to use override scope of *JOB. Not always appropriate, but for older code shouldn't cause much of a problem, especially if all you changed is to compile as ILE.

Posted by: neilrh
Premium member *
Jackson, MI
Comment on: Resolved - OVRDBF and OPNQRYF broke
Posted: 5 years 5 months 10 days 21 hours 38 minutes ago

I thought about that but all these programs are OPM and not compiled since 2005 or earlier.

Posted by: neilrh
Premium member *
Jackson, MI
Comment on: Resolved - OVRDBF and OPNQRYF broke
Posted: 5 years 5 months 10 days 21 hours 32 minutes ago

We tried OVRSCOPE and OPNSCOPE, no effect with either of these.  The program was working last week, and suddenly stopped today (maybe yesterday) sometimes it can take users a while to figure out something is broken.

Posted by: bobcozzi
Site Admin ****
Chicagoland
Comment on: Resolved - OVRDBF and OPNQRYF broke
Posted: 5 years 5 months 10 days 21 hours 23 minutes ago

I would first look at the objects in the jobstream and verify that they have not been recompiled recently. Then to fix the problem, I'd try changing to CLLE.

The IBM team involved in CL nowadays is someone missing the historical experience and knowledge of this system. Its the first time ever that I've had bugs in CL and commands since the system was announced. Of course they haven't really enhanced CL much except for that short bubble in the last decade.

Posted by: neilrh
Premium member *
Jackson, MI
Comment on: Resolved - OVRDBF and OPNQRYF broke
Posted: 5 years 5 months 10 days 21 hours 13 minutes ago

Just tried the CLLE thing before you mentioned it, no joy.  Think I'll call it a day and hit this with a fresh mind in the morning.

Posted by: neilrh
Premium member *
Jackson, MI
Comment on: Resolved - OVRDBF and OPNQRYF broke
Posted: 5 years 5 months 10 days 5 hours 30 minutes ago

ok, we checked some other programs this morning that perform a share override and then OPNQRYF and the RPG is working as expected.  It seems our issue is one single file, that someone was copying about 15million records into.  Any chance that we could have blown something up in DB2?

Tests so far include:

  • OVRDBF SHARE(*YES), OPNQRYF, call rpgpgm - fail: Query running. 5 records selected, 5 processed.  RPG read = %eof condition.
  • OPNQRYF, CPYFRMQRYF - success, 16 records selected into the work file
  • STRSQL, SELECT - success, 16 records selected and displayed

Must admit this has me stumped.

Posted by: neilrh
Premium member *
Jackson, MI
Comment on: Resolved - OVRDBF and OPNQRYF broke
Posted: 5 years 5 months 10 days 4 hours 9 minutes ago

The problem was eventually traced to - crap code.