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













"Douglas A. Griffin" <degriff@srv.net> on 99-03-27 16:06:38

Please respond to RPG400-L@midrange.com
                                                                                
                                                                                
                                                                                


                                                              
                                                              
                                                              
 To:      RPG400-L@midrange.com                               
                                                              
 cc:      (bcc: Stefan Tageson/MMX/Sema Group/SE)             
                                                              
                                                              
                                                              
 Subject: Re: Determine Spool file attributes//spoolfile      
          archiving                                           
                                                              








> Hi.  A related question.  I have a bunch of spool files for a job that is
> already finished sitting in an outq.  I want to back up these files to tape
> and the only way I know how to do that is copy them to a physical file using
> CPYSPLF (if there is a better way please let me know).  There are several
> thousand of them so I need to write a program rather than do it from the
> command line.

> Since these files were created with multiple jobs previously run I can't use
> the file feedback data structure to retrieve the spool file attributes I
> need. required by CPYSPLF.


Hi,
found this code some time ago, I haven't used it. Try it if you like and please
tell me if it worked.

Regards

// Stefan Tageson
+>----------------------------------------------------------------------<+
  tel:         +46 40 693 3500
  fax:         +46 40 693 3600
  mobile: +46 708 51 3543
  e-mail       stefan.tageson@notes.sema.se
+>---------------------------------------------------------------------<+
TITLE: ...... Using QSPGETF and QSPPUTF APIs with Command Source


DESCRIPTION:

Using QSPGETF and QSPPUTF APIs with Command Source

This document covers usage of the QSPGETF and QSPPUTF print APIs.
The command source for the QSPGETF API is supplied if the user wants to facility
 usage at a command entry screen.
This is intended for archiving or AS/400 support diagnostics when the spoolfile
printer device type is *AFPDS, *IPDS,
 or special controls in the spoolfile that does not allow the CPYSPLF command to
 work.

These are the instructions to archive the spool file to a physical file. Use
QSPPUTF to restore as a spoolfile.

Let the program create the file for you. If you have problems with it creating,
then create before running the program.

Enter at the command line:

CRTPF FILE( ) RCDLEN(4083) MAXMBRS(*NOMAX) +
SIZE(*NOMAX) LVLCHK(*NO)

Example usage of the QSPGETF API to write to a member in your database file:

CALL PGM(QSYS/QSPGETF) PARM('QPRINT ' 'SPOOLDB USER1LIB ' 'DSP03 USER1 010160'
X'0001' 'MBR1 ')

This API call dumps a spool file QPRINT to a database file SPOOLDB in USER1LIB
library, member MBR1.
The spool file number is 1. The spool file job is 010160/user1/dsp03. This
information can be seen in the WRKSPLF screen by pressing F11 or using Optioin
2.

The parameter values must be in uppercase and there must be a space between the
single quotation marks.
Following are the parts to the parameter list: o
 The 10-character spool file name.

o  A 20-character database file and library. Allow for 10 characters for each
name.

o  A 26-character qualified job name for the spool file. This name can be seen
in the WRKSPLF screen (press F11).
    Allow 10 characters each for the job name and user, and 6 positions for the
job number.

o  Numeric file number, 1 through 9999. Use the hexadecimal representation as in
 the example.
    Make sure a space is inserted after the previous single quotation mark and
the X'0001'.

o  10 characters for the database member.

To restore the spool file from the database follow the example and instructions
below.

Example usage of the QSPPUTF API to create a spoolfile from a member in your
database file:

CALL PGM(QSYS/QSPPUTF) PARM('SPOOLDB USER1LIB ' 'USER1 QGPL ' 'MBR1 ')

This API call creates a spool file in USER1 output queue in QGPL library from
the MBR1 member in the SPOOLDB database file.

The parameter values must be in uppercase, and there must be a space between the
 quotes. Following are the parts to the parameter list: o
 20-character database file and library. Allow for 10 characters for each name.

o  20-character output queue name and library. Allow for 10 characters for each
name.

o  10 characters for the database member.


The above API programs can be run from the command line or from a CL program.
If you are going to use these APIs on a regular basis, a command interface would
 be more convenient. The following is the command source for the QSPGETF API.

The source code for command GETSPLF, command interface to QSYS/QSPGETF follows.
To compile the command, on the OS/400 command line type the following:

CRTCMD CMD(lib_name/GETSPLF) PGM(QSYS/QSPGETF) +
SRCFILE(lib_name/file_name) SRCMBR(*CMD)

GETSPLF: CMD PROMPT('Get Spooled File')
PARM KWD(FILE) TYPE(*NAME) LEN(10) RTNVAL(*NO) RSTD(*NO) MIN(1) +
MAX(1) FILE(*IN) FULL(*NO) EXPR(*YES) VARY(*NO) PASSATR(*NO) +
PROMPT('Spooled file')
PARM KWD(TOFILE) TYPE(Q1) RTNVAL(*NO) MIN(1) MAX(1) FILE(*OUT) +
PROMPT('To data base file')
PARM KWD(JOB) TYPE(Q2) RTNVAL(*NO) DFT(*) SNGVAL(*) MIN(0) MAX(1) +
FILE(*NO) PROMPT('Job name')
PARM KWD(SPLNBR) TYPE(*INT2) RTNVAL(*NO) RSTD(*NO) DFT(*ONLY) +
RANGE(1 9999) SPCVAL((*ONLY 0) (*LAST -1)) MIN(0) MAX(1) +
EXPR(*YES) VARY(*NO) PASSATR(*NO) PROMPT('Spooled file number')
PARM KWD(TOMBR) TYPE(*NAME) LEN(10) RTNVAL(*NO) RSTD(*NO) +
DFT(*FIRST) SPCVAL(*FIRST) MIN(0) MAX(1) FILE(*NO) FULL(*NO) +
EXPR(*YES) VARY(*NO) PASSATR(*NO) PROMPT('To member')
Q1: QUAL TYPE(*NAME) LEN(10) RSTD(*NO) MIN(1) FULL(*NO) VARY(*NO) +
EXPR(*YES) PASSATR(*NO)
QUAL TYPE(*NAME) LEN(10) RSTD(*NO) DFT(*LIBL) MIN(0) FULL(*NO) +
SPCVAL((*LIBL) (*CURLIB *CURLIB)) VARY(*NO) EXPR(*YES) +
PASSATR(*NO) PROMPT('Library')
Q2: QUAL TYPE(*NAME) LEN(10) RSTD(*NO) MIN(1) FULL(*NO) +
VARY(*NO) EXPR(*YES) PASSATR(*NO)
QUAL TYPE(*NAME) LEN(10) RSTD(*NO) MIN(0) FULL(*NO) VARY(*NO) +
EXPR(*YES) PASSATR(*NO) PROMPT('User')
QUAL TYPE(*CHAR) LEN(6) RSTD(*NO) RANGE(000000 999999) MIN(0) +
FULL(*YES) EXPR(*YES) PASSATR(*NO) PROMPT('Number')

----------------------------------------------------------------------
The source code for command PUTSPLF, command interface to QSYS/QSPPUTF follows
(see Note below). To compile the command, on the OS/400 command line type the
following:

CRTCMD CMD(lib_name/PUTSPLF) PGM(QSYS/QSPPUTF) +
SRCFILE(lib_name/file_name) SRCMBR(*CMD)

Note: The source is not included, Use the GETSPLF as an example.



* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* This is the RPG/400 Discussion Mailing List!  To submit a new         *
* message, send your mail to "RPG400-L@midrange.com".  To unsubscribe   *
* from this list send email to MAJORDOMO@midrange.com and specify       *
* 'unsubscribe RPG400-L' in the body of your message.  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.