|
Jerry;
Add a procedure that takes the name of the file. Get the record format name (QUSLRCD - List Record Formats API) and OVRDBF the file.
Duane Christen
--
Duane Christen
Senior Software Engineer
(319) 790-7162
Duane.Christen@xxxxxxxxxx
Visit PAETEC.COM
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Jerry Adams
Sent: Friday, September 17, 2010 12:54 PM
To: Midrange-RPG (rpg400-l@xxxxxxxxxxxx)
Subject: Level Check Problem
I have three tables that have exactly the same fields (by both name and attribute); the only difference is the name of the record format, which causes each one to have a unique record format identifier.
Without realizing this (or even thinking about it), I wrote a program to process each table - but only defining one table in the program using the USROPN and EXTFILE keywords. The subprocedure was being passed the name of the "real" table I wanted for each pass and then OPENing it based upon the EXTFILE(FileName) value. During testing is when it hit me (like a ton of bricks) that each table had a different record format id.
I know that I can use OVRDBF with LVLCHK(*NO), but that doesn't work for USROPN tables. I could not find a File Level keyword in the RPG IV manual that would prevent this and MONITORing for the error would simply result in the table not being opened.
The only alternatives that I have come up with are to either:
1. Define each table in the program and create three subprocedures
2. Rebuild the tables with the same record format name.
I don't like the latter, obviously, because it would affect other programs already in production. I thought of using QCMDEXC in the program to actually issue an OVRDBF, but I don't think this would work because I still could not use a RENAME on the File spec.
So am I stuck with option #1? Or is there an alternative that I have overlooked?
Thanks.
Jerry C. Adams
IBM System i Programmer/Analyst
To assert that the earth revolves around the sun is as erroneous as to claim that Jesus was not born of a virgin. -Cardinal Bellarmine during the trial of Galileo
--
B&W Wholesale
office: 615-995-7024
email: jerry@xxxxxxxxxxxxxxx
--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l.
--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.