|
In a lot of the older programs I've come across, the program name was passed in a parameter. I've yet to see another option than that. "Jim Wiant" <Jim.Wiant@foodst uffs.co.nz> To Sent by: "RPG programming on the AS400 / rpg400-l-bounces@ iSeries" <rpg400-l@xxxxxxxxxxxx> midrange.com cc Subject 07/20/2006 03:54 RE: Find the calling program PM Please respond to RPG programming on the AS400 / iSeries <rpg400-l@midrang e.com> One way I've solved this problem is to always pass the address of the SDS of the calling program to any sub program. The sub program will then have all the details of the parent. However, as you pointed out this has the limitation of relying on structure/standards to maintain the integrity. Other programs I've seen rely on the LDA to pass this data. But again, the integrity needs to be forced. I would also be interested in a better method if anyone has one. Jim The bitterness of poor quality remains long after low pricing is forgotten! Cautillo, Leon M. -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Mike Cunningham Sent: Friday, 21 July 2006 7:25 To: rpg400-l@xxxxxxxxxxxx Subject: Find the calling program Is there any way for an RPG to determine what program called it? I am writing a service program that writes records to a database and one of the fields I want to store is the name of the program that asked the service program to create the record. So PGMA calls PGMB that calls SERVICEPGM I want SERVICEPGM to write a database record with PGMB in the tracking field. I have done this many years ago but at that time I passed a parameter to know who was requesting the service but then all the code was mine and I trust my code :) This time a lot of people will be using the service program and I would prefer not to let them pass me anything they want. Mike Cunningham Pennsylvania College of Technology www.pct.edu mcunning@xxxxxxx -- This is the RPG programming on the AS400 / iSeries (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 message was scanned for compliance with Foodstuffs email policies ###################################################################### This message has been sent from Foodstuffs (Auckland) Limited ("Foodstuffs"). The information contained in this message and or attachments is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any system and destroy any copies. The views and opinions expressed in this message may be those of the individual and not necessarily those of Foodstuffs, and are not given or endorsed by it. Please note that this communication does not designate an information system for the purposes of the Electronic Transactions Act 2002. -- This is the RPG programming on the AS400 / iSeries (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-2025 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.