× 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: Kevin Wright <Kevin.Wright@xxxxxxxxxxxxx>
  • Date: Thu, 25 May 2000 12:13:21 +1000

Hi Evan,

You do not mention which part of the file information data structure you
were retrieving the file name from. If it was *FILE or positions 1 - 8 then
these return the first 8 characters of the file name in the F-spec. Jon
Erickson's extract from TFM mentions positions 83 - 92 (FILE_NAME), and I
believe that this is the actual or external file name that is used.

Feel free to ignore this if you are already picking up positions 83 - 92 and
this shows the F-spec file name.

HTH,

Kevin W.

> -----Original Message-----
> From: Evan Harris [mailto:spanner@ihug.co.nz]
> Sent: Wednesday, 24 May 2000 19:19
> To: RPG400-L@midrange.com
> Subject: Retrieving Spool File Name in RPG
> 
> 
> 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
> +---
> 
+---
| 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 ...


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.