|
Hi all While assisting in a spool file distribution project I came across an interesting problem that someone here might be able to assist me with. Basically the problem is that we have a distribution server program monitoring a dataqueue attached to an outqueue. The distribution program is driven by a combination of the USRDTA parameter on the spool file and the spool file name. All is well here, and the distribution program works fine. While tossing about possible methods to set the USRDTA value of the spool files, the programmers responsible for the application programming stated that they did not feel it was productive to create a CL for every RPG that would need to set the USRDTA value and wanted to accomplish this from within the RPG program. This would avoid coding lots of CL's that merely passed parameter strings after doing an OVRPRTF. Perhaps this is a valid objection, perhaps it isn't. I'm not really able to influence their preference, in any event I figured that what they wanted to do ought to be easily accomplished from within the RPG with a bit of thought. My initial thought was to use the INFDS to get the spool file details and the PSDS to get the job details and call a CL that would set the USRDTA using CHGSPLFA. This worked fine, except in one instance and this is the basis my question. If the Spool file name is overriden in a CL prior to calling the RPG there appears to be no way of retrieving the spool file name into the RPG. The INFDS contains the name of the file being used not the overriden-to spool file name. Spool file name is, of course, required for the CHGSPLFA command. I attempted to use the Retrieve File Override API but this returned all blanks either because the file is not considered overridden becuase only the spool file name is changed, or because I coded it incorrectly. It certainly looked OK and seemed to return the correct data. Now, I realise I could use one of the Spool file API's retrieve a list of the spool files for the job and search for a spool file with a matching spool file number but this seums an unnecessary amount of work to go to. I would have thought that the information I want is relatively easily obtained from somewhere within the RPG. Does anyone have any thoughts on how I would accomplish this ? Regards Evan Harris +--- | This is the RPG/400 Mailing List! | To submit a new message, send your mail to RPG400-L@midrange.com. | To subscribe to this list send email to RPG400-L-SUB@midrange.com. | To unsubscribe from this list send email to RPG400-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.