|
Hi, Tim: Tim Truax <truax@usaor.net> on 10/09/97 01:37:48 AM To: midrange-L <midrange-L@midrange.com> @ INTERNET cc: Subject: PGM assist? > MAIN QUESTION AREA: > > In order to get this program to compile I had to CRTDUPOBJ DUPDATA(*NO) > the USSRCHM file into my library as UXSRCHM, then place an OVRDBF for > UXSRCHM to point to actual USSRCHM file. Is creating an empty file > object considered proper to getting the program to compile? Another way, is to: o 'program describe' the UXSRCHM, with a really big record size, and define some extra information for processing USSRCHM, as follows: FUSSRCHM IP E DISK KINFDS FILEDS FUXSRCHM UF F 9999 DISK F KRECNO GETRRN (you won't need input specs for this file, and I'll discuss the RECNO line shortly and the INFDS shortly) o Put an externally-described data structure into your program, such as: IRECDS E DSUSSRCHM o Define the file data structure that you promised RPG, like: IFILEDS DS I B 397 4000$REC# o Define GETRRN (or some field name, matching the RECNO line from above) (numeric, 8,0) o When you find a record that you want to update, $REC# will contain the Relative Record Number within the physical file. We can use that to retrieve the record for update, as follows: C Z-ADD$REC# GETRRN C GETRRN CHAINUXSRCHM RECDS 60 (or whatever indic you want) (This will retrieve the record for update, and put its data into your data structure RECDS. After populating/changing the fields you want to effect, simply do the following: C UPDATUXSRCHM RECDS No extra files needed, no extra compile wrappers needed. The only two ill effects of this approach are: o If your filesize ever actually exceeds 9999 bytes, (God forbid!), this approach will not work o You will get a "Buffer size longer than record size" message in the joblog when the file is opened (severity 10, no big deal). I hope this helps. (The following signature looks right only with a fixed-pitch font) *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~* * _ _ * * / ) ( \ * * _ / / Dennis Lovelady \ \ _ * * ( ( () _ Unix / AIX System Administrator _ () ) ) * *( \ \ \) / ) Oracle D.B.A. ( \ (/ / / ) * ( \ \ \ \_/ / \ \_/ / / / )* *\ / Dennis@Lovelady.com \ / * * \ / Dennis.Lovelady@KEMET.com \ / * /~~\ /~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\ /~/\* [[[|]]] Simpsonville, SC. [[[|]]]( * \__[[[|]]]__________________________________________________[[[|]]]_\/ +--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to "MIDRANGE-L@midrange.com". | To unsubscribe from this list send email to MAJORDOMO@midrange.com | and specify 'unsubscribe MIDRANGE-L' in the body of your message. | Questions should be directed to the list owner/operator: david@midrange.com +---
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.