Thank you!!! This worked so perfectly and simply. Simple is good.
OVRPRTF FILE(QPRINT) SPLFNAME(PAR01B_ABC)
*call 'QSPRILSP' using ...
77 spl-data pic x(70).
77 spl-parm2 pic x(4) value x'00000046'.
77 spl-parm3 pic x(8) value 'SPRL0100'.
77 spl-err pic x(8).
call 'QSPRILSP' using spl-data
inspect spl-data converting '_' to '-'
string 'Report ID: '
delimited by size
Hdrline3 is now:
Report ID: PAR01B-ABC
Its like magic!
Thanks for all the links and info - IBM had some great examples that I copied at
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of CRPence
Sent: Tuesday, April 24, 2012 4:28 PM
Subject: Re: automagic page heading routine
I did not explicitly recall the SPLFNAME being there. That is why I
was so non-committal on my opening remarks, per "if... not available".
But I had forgotten entirely that the SPOOL_FILE and SPOOL_LIB in the
INFDS Open Feedback data were identifying the implementation object for
spool data storage, i.e. identify the spool-database-file[.member] which
stores the spooled data for the opened printer file. Thus the spool_lib
value presumably should always be a QSPL#### library.
FWiW, I looked up a more generic documentation for the "Open feedback
area for printer" file ODP:
"... Parent topic: Printer file feedback areas"
Generally the control program sets the desired SPLFNAME [e.g. using
OVRPRTF] and then does what needs to be done [e.g. selection by name]
based on that spool file name, after the control is returned. However
in the described scenario, the report program or more specifically the
"automagic page heading routine" is what needs to know an attribute that
generally would have been set by a control program. The control program
could either pass the data to the reporting program [e.g. in a
parameter, in addition to still setting that value in the override] or
extract the "report-id" value [as obtained from the SPLFNAME data] after
the spool file has been created [per opening the printer file]. For a
scenario whereby the called routine must infer\extract from the spool
file name versus a passed parameter, and for lack of that data being
found [easily] in any Data Management Feedback Area, using the QSPRILSP
API is much more succinct and simple than would be using either the Open
List of Spooled Files (QGYOLSPL) API or the List Spooled Files (QUSLSPL)
API; and probably more so than any other methods [esp. something silly
like copying\reading output from a "wrkjob output(*print)
option(*splf)"] that could be employed to find the name.
On 24 Apr 2012 13:18, Stone, Joel wrote:
In COBOL, I tried using the SPECIAL-NAMES. OPEN-FEEDBACK IS OF-AREA.
Also tried I-O-FEEDBACK IS IO-FEEDBACK.
But I can't see the override spool file name. I would like to
retrieve "FILE1", but in the OFA I can only see the original
spool <ed: printer> file name HIP544PRT.
I am guessing that RPG and COBOL's feedback area contains similar
stuff, which doesn't include the real file name "FILE1" (the one I
see with WRKSPLF).
Any ideas? Is API the only solution? Or would that only return the
original spool file name and not the over-ridden name?
OVRPRTF FILE(HIP544PRT) SPLFNAME(FILE1)
call hip544b (&TITLE1 &TITLE2 &ShowCust)
<<SNIP>> Variable . . . . . . . . . : 01 OFA-AREA
Type . . . . . . . . . . . . . . . . : CHARACTER
Length . . . . . . . . . . . . . . . : 300
---> 'SPHIP544PRT TPGMLIB Q04079N010QSPL ¬¬¬¬¬¬Q7'
CRPence on Tuesday, April 24, 2012 1:39 PM wrote:
If the [device specific] "Open Feedback" is not available, or the
spool file name is not available via an INFDS, then any [HLL] as
report generator could, after the open of the printer file, use the
following API to get the Spool File Name [and spool file number].
_i Retrieve Identity of Last Spooled File Created (QSPRILSP) API i_
"... The Retrieve Identity of Last Spooled File Created (QSPRILSP)
API returns the complete spooled file identity of the last spooled
file created for the current job or thread. ..."
If the program PAR01B is RPG, and that program wants to know what
the SPLFNAME() used for the printer file opened, then the
following would appear to describe where the data is [albeit I can
make no sense of the "spool library" and AFaIK the 2-byte spool
file number is deprecated with the aforementioned API as