× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: Re: Retrieving Spool File Name in RPG
  • From: Evan Harris <spanner@xxxxxxxxxx>
  • Date: Tue, 30 May 2000 08:14:10 +1200

Joep et al,

>Do you think that delving in the intricacies of  and experimenting with with
>calling CHGSPLFA from within an RPG, then changing x RPG programs to do this
>call is less work than writing x minimalist CL programs?

I certainly don't, however, the programmers who maintain the application do 
<sigh>  As a side note, there is nothing intricate about retrieving the 
necessary details for what I want to do, it is just a bit more hackwork 
than I expected - that was meant to be the flavour of my original post.

Where I am really trying to get to, is a situation where I can easily 
extract some information from the running program (i.e. Spool file name, 
user ID, job name, job number etc) and pass it to a procedure or program so 
that the necessary disitribution parameters can be set. I would much prefer 
to have this common code external to each of the programs that will utilise 
it, as I could even see a case where the distribution value was 
derived/calculated based on job/user information rather than coded into the 
program as a value as is currently the intention of the programmers.

It seems to me that it would be an equally valid approach to ask the 
programmers to include program and file information structures in the RPG 
in a standard way, and to call a standard program for each printer file in 
the program. This is no more overhead than having a prior CL handle the 
OVRDBFs, and some might even argue that it is preferable because the 
invocation stack is minimized. It also offers the advantage that should I 
alter the print distribution logic I (hopefully) do not need to revisit 
umpteen CL's or rework a stack of RPG's, I only need to change the 
distribution program itself.

>Anyway, an option might be to make the printer files USROPN and do an
>override in *INZSR through QCMDEXC (or system()) before opening.

I understand that it can be done this way. My question was did anyone know 
if there was a simple method to retrieve the spool file name from within an 
RPG. I thought I might be missing something in the use of the INFDS and the 
Program Status DS. It appears that either there isn't, or no-one knows how 
it is done.

I'll go back to writing a program that can perform the necessary work from 
within the RPG. There is enough information in there for me to do this - 
it's just not as readily obtainable.

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 thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.