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



In COBOL, I tried using the SPECIAL-NAMES. OPEN-FEEDBACK IS OF-AREA.

Also tried I-O-FEEDBACK IS IO-FEEDBACK.

But I cant see the over-ride spool file name. I would like to retrieve "FILE1", but in the OFA I can only see the original spool 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?

Thanks


OVRPRTF FILE(HIP544PRT) SPLFNAME(FILE1)
call hip544b (&TITLE1 &TITLE2 &ShowCust)


Program . . . . . . . . . . . . . . . . : HIP544B
Recursion level . . . . . . . . . . . . : 1
Start position . . . . . . . . . . . . : 1
Format . . . . . . . . . . . . . . . . : *CHAR
Length . . . . . . . . . . . . . . . . : *DCL

Variable . . . . . . . . . . . . . . . : 01 OFA-AREA
Type . . . . . . . . . . . . . . . . : CHARACTER
Length . . . . . . . . . . . . . . . : 300
*...+....1....+....2....+....3....+....4....+....5
---------------------> 'SPHIP544PRT TPGMLIB Q04079N010QSPL ¬¬¬¬¬¬Q7'
'77375375¬¬¬¬¬¬¬¬¬¬¬¬¬¬â¬µ¬¬¬¬¬¬¬¬s¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬'
'¬¬¬¬¬¬¬¬¬¬¬¬¬¬ ¬*N ¬¬¬¬¬¬¬¬)¬¬¬¬¬¬¬¬¬¬¬¬¬*N'
' ¬¬¬ø¬¬¬¬¬¬¬á¬á¬á¬á¬[¬á¬á¬á¬ø¬á¬á¬á¬á¬á¬á¬á'

-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of CRPence
Sent: Tuesday, April 24, 2012 1:39 PM
To: midrange-l@xxxxxxxxxxxx
Subject: Re: automagic page heading routine

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_
http://publib.boulder.ibm.com/infocenter/iseries/v5r4/topic/apis/QSPRILSP.htm
"... 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 recommendation]:

WebSphere Development Studio: ILE RPG Language Reference
File Information Data Structure
http://publib.boulder.ibm.com/infocenter/iseries/v5r4/topic/books_web/c092508687.htm#HDRFILINDA
"
A file information data structure (INFDS) can be defined for each file
to make file exception/error and file feedback information available to
the program. The file information data structure, which must be unique
for each file, must be defined in the main source section. The same
INFDS is used by all procedures using the files.

The INFDS contains the following feedback information:

* File Feedback (length is 80)
* Open Feedback (length is 160)
* Input/Output Feedback (length is 126)
* Device Specific Feedback (length is variable)
* Get Attributes Feedback (length is variable)

...

Figure 27. Example of Coding an INFDS with Open Feedback Information

FFilename++IPEASFRlen+LKlen+AIDevice+.Keywords++++++++++...
FMYFILE O F 132 PRINTER INFDS(OPNFBK)
DName+++++++++++ETDsFrom+++To/L+++IDc.Keywords++++++++++...
DOPNFBK DS
D ODP_TYPE 81 82
D FILE_NAME 83 92
D LIBRARY 93 102
D SPOOL_FILE 103 112
D* Spool file name
D SPOOL_LIB 113 122
D* Spool file lib
D SPOOL_NUM 123 124I 0
D* Spool file num

...
"

Regards, Chuck

On 24 Apr 2012 07:24, Stone, Joel wrote:
I created an automagic page heading routine to center the title, grab
the date/time, increment page#, etc.

The last piece is the report-id. Can someone suggest how to get
this?

I would like it to be the spool file name.

In our shop, pgm name could be PAR01B for Program Accounts
Receivable.

Spool file name could be RAR01B (1st R for report of course).

Can I retrieve the spool file name from a COBOL pgm? This spl file
could have been over-ridden. I would like the spool file name that
is currently open.

For example, pgm PAR01B could be used to create 3 different reports -
RAR01B-A; RAR01B-B, and RAR01B-C.

The CL would look like:

OVRPRTF FILE(PRNTR) SPLFNAME(RAR01B-C)
CALL PAR01B

In COBOL (or anything else), how can I retrieve the spool file name
RAR01B-C ?


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.