I want to change the spoolfile attributes of the latest created spoolfile
in my program.
is there a possibility to retrieve the number of the last spoolfile created
in this RPG program?
thanks a lot if you can help me!
Yves Veys
Yves Veys wrote in article <01bc7cd6$05855140$55000182@pws085>...
... AND: In the CHGSPLFA cmd use "SPLNBR(*LAST)"
Greetings
Helmut Salzer
Webmaster
Lauda's CARFOX
Profi Reifen Service Ges.m.b.H.
Office: webm...@laudas-carfox.co.at
http://www.laudas-carfox.co.at/carfox/
Privat: salz...@ping.at
http://members.ping.at/salzer.h/as400.htm
The rpg-program creates more than one spoolfile, and I really want the
number of the latest created spoolfile in this program.
The Styer Family <pst...@netsync.net> wrote in article
<5ocm58$281$2...@mica.netsync.net>...
> This is simple in a CL program. Override the spool file before calling
the
> RPG program with HOLD(*YES). Call the RPG program to create the spool
> file. Use CHGSPLF command to modifiy the attributes and then release the
> spool file.
>
CHGSPLFA xxxxx SPLNBR(*LAST)
--
Helmut Salzer
Webmaster
Lauda's CARFOX
Profi Reifen Service Ges.m.b.H.
Office: webm...@laudas-carfox.co.at
http://www.laudas-carfox.co.at/carfox/
Privat: salz...@ping.at
http://members.ping.at/salzer.h/as400.htm
Yves Veys <yves.veys...@infoboard.be> schrieb im Beitrag
<01bc7d4d$a7881b40$55000182@pws085>...
Ok, and if I want the number of the second last spoolfile created in this
program .....
thanks
Helmut Salzer <pr...@profi-reifen.co.at> wrote in article
<01bc7d6d$ec1f1ae0$22be...@ATPROFIPC1.ATPROFI>...
Check the RPG manuals for detailed information on the exact subfield
locations within the file information structure.
Don't forget to add a continuation line with INFDS on your F-Spec for the
thing to work.
Success
Marcel Groeneweg
CMG
Netherlands
----
Opinions expressed here are my own.
Using the information supplied here is at your own risk
and responsibility.
Ok, for the LAST spoolfile the CHGSPLFA xxx (*LAST) is the right solution.
If you need to change another spoolfile number you can either determine
this number via the INFDS or SDS or use one of the useful spool-APIs.
Greetings
--
Helmut Salzer
Webmaster
Lauda's CARFOX
Profi Reifen Service Ges.m.b.H.
Office: webm...@laudas-carfox.co.at
http://www.laudas-carfox.co.at/carfox/
Privat: salz...@ping.at
http://members.ping.at/salzer.h/as400.htm
Yves Veys <yves.veys...@infoboard.be> schrieb im Beitrag
<01bc7d93$d82996c0$55000182@pws085>...
There are a couple of techniques that should do what you want
1) Use a file information data structure associated with your printer file
F-spec
(RPG/400 example)
FQPRINT O F 198 OA PRINTER KINFDS PRT#DS
* ~~~~~~~~~~~~~
IPRT#DS DS
* Offset 83 is the file name
I 83 92 SPLNAM
* Define the offset 123 as a 2 digit binary field to get
* the spoolfile number
I B 123 1240SPLNBR
2) Associate a data queue with the ouput queue that your spooled output
goes to. An entry is then generated by the system for each new spoolfile
that arrives in Ready state on the queue, with job and spool file details.
This method is fine if the output queue is only used by your program while
you're collecting your info, but you would need to sift out files created
by other jobs if they spool to the same queue. The data queue needs to be
128 char long (or more). The info is stored as follows:
first 10 char: Function that created the entry (*SPOOL in this case)
next 2 char: Record type (01 = spool file in Ready state)
next 26 char: qualified job name (job/user/number)
next 10 char: spool file name
next 4 char (binary value): spool file number
next 20 char: qualified output queue (queue/library)
next 56 char: IBM stuff!
I can email you examples of both techniques in action, once I've hunted out
the code at work, if you don't get a more complete answer first.
HTH
Regards, Martin
--
mar...@mjrowe.prestel.co.uk (home)
Marti...@Moores.co.uk (work)
Yves Veys <yves.veys...@infoboard.be> wrote in article
:
Our AS/400 Report Splitter report distribution software has a built in
API you can use to retrieve AS/400 Spool File information including the
spool file number.
For more information, contact me via Email or phone, or take a look at
our Web Site.
Regards,
Richard Schoen
RJS Software Systems
"The AS/400 Client Server Data Experts"
Phn: (888) RJSSOFT
Fax: (612) 822-1364
Visit our home on the World Wide Web
http://www.rjssoft.com