|
Hello Jim, RPG III, RPG/400, and RPG IV only run on the AS/400. AS/400 program objects do not run on other platforms. The source cannot even be moved unless you take no advantage of the AS/400. Other than some half-arsed attempts at putting a 400-like environment on PCs (why would you bother) every other RPG compiler I am aware of is a dialect of RPG II. Ergo, no externally described data, no CAT, SUBST, CHECK, CHECKR, SELEC, etc, etc, etc. All AS/400 programs are re-entrant -- meaning all jobs using a given program share the same program code (only one copy in main store) but have separate variable storage in the PAG. No RPG program is recursive except RPG IV if AND ONLY IF you use the procedure support. Recursion is only supported in languages which use automatic storage. RPG uses static storage. Automatic storage is allocated each time the program is called; static is only allocated the first time. The big problem with making RPG recursive is not so much where you define the variables but the fact that the RPG logic cycle is present in every RPG program even if you request full-procedural processing for files and the cycle is not recursive. The RPG compiler embeds code to detect whether a given program is already active in the job and generates an exception if it is. So ... RPG III/400 is not recursive C is recursive CL is recursive -- who'd've believed that then! CBL is not recursive (I think) PL/1, FORTRAN, BASIC -- not sure but all are re-entrant. So to deal with your specific questions: >1. What are all other possible platforms an RPG III program object can run on ? NONE - you can try to move the source but I doubt that will work without serious rework. >2. By what method does one code an RPG III program routine to be reentrant ? NONE - they simply are. The system handles it all. >What was done in the COBOL programs to make them reentrant was to define all >program >variables in the Linkage Section, in RPG that would be the *ENTRY PLIST... Nothing to do with re-entrancy. Regards, Simon Coulter. //---------------------------------------------------------- // FlyByNight Software AS/400 Technical Specialists // Phone: +61 3 9419 0175 Mobile: +61 3 0411 091 400 // Fax: +61 3 9419 0175 E-mail: shc@flybynight.com.au // // Windoze should not be open at Warp speed. +--- | 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 MIDRANGE-L-UNSUB@midrange.com. | 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.