One way
- WRKSPLF can output to a spool file
- The Spool file can be copies to a flat file
- Your rpg program reads the flat file - moves record to data structure and loads SFL record
There is probably an API and/or a TATOOL for this but I've used this method.
Phil
Last Wiki Answer Submitted: December 1, 2008 4:49 pm by philpl1jb44,190 pts.
All Answer Wiki Contributors: philpl1jb44,190 pts.
If you live outside the United States, by submitting your email address you consent to having your personal data transferred to and processed in the United States.
The List Spooled Files API (QUSLSPL) is one option, the other API you could use is the Open List of Spooled Files (QGYOLSPL) API. There are several differences between the two, as the following snippet from the Information Center highlights:
<snippet>
The QUSLSPL API puts the list of spooled files into a user space object provided by the caller. The calling program can directly access the user space storage. The QGYOLSPL API puts the list of spooled files into a temporary space and assigns a handle for the list. The calling program cannot directly access the storage where the list is placed. Instead, the calling program can retrieve entries from the list by passing the assigned list handle to the Get List Entries (QGYGTLE) API.
The QUSLSPL API does not return control to the calling program until the list of spooled files is completely built in the user space object. The QGYOLSPL API returns control as soon as the initial number of records requested has been placed in the list. If the calling program requests zero records to be returned initially, QGYOLSPL returns immediately after it verifies parameter values, does some initial setup operations, and requests that the asynchronous host server job builds the list.
The QGYOLSPL has a receiver variable parameter. The receiver variable contains the initial number of records, if any, requested.
The QGYOLSPL has a list information parameter that contains the status information about the list that was built or is being built.
The QUSLSPL API allows filtering on only one user profile name. The QGYOLSPL API allows filtering on multiple user profile names.
The QUSLSPL API allows filtering on only one output queue name. The QGYOLSPL API allows filtering on multiple output queue names.
The QUSLSPL API does not allow filtering on spooled file status. The QGYOLSPL API allows filtering on multiple spooled file statuses.
The QUSLSPL API does not allow filtering on printer name. The QGYOLSPL API allows filtering on multiple printer names.
The QUSLSPL API returns the list of spooled files in only one order. The QGYOLSPL API has a sort information parameter to allow sorting on one or more of the fields in the list.
<End of snippet>
Depending on your needs, you should evaluate which API is the most applicable.
Hi,
You should be able to use the List spooled files API
Regards,
Martin Gilbert.
Hi,
The List Spooled Files API (QUSLSPL) is one option, the other API you could use is the Open List of Spooled Files (QGYOLSPL) API. There are several differences between the two, as the following snippet from the Information Center highlights:
<snippet>
The QUSLSPL API puts the list of spooled files into a user space object provided by the caller. The calling program can directly access the user space storage. The QGYOLSPL API puts the list of spooled files into a temporary space and assigns a handle for the list. The calling program cannot directly access the storage where the list is placed. Instead, the calling program can retrieve entries from the list by passing the assigned list handle to the Get List Entries (QGYGTLE) API.
The QUSLSPL API does not return control to the calling program until the list of spooled files is completely built in the user space object. The QGYOLSPL API returns control as soon as the initial number of records requested has been placed in the list. If the calling program requests zero records to be returned initially, QGYOLSPL returns immediately after it verifies parameter values, does some initial setup operations, and requests that the asynchronous host server job builds the list.
The QGYOLSPL has a receiver variable parameter. The receiver variable contains the initial number of records, if any, requested.
The QGYOLSPL has a list information parameter that contains the status information about the list that was built or is being built.
The QUSLSPL API allows filtering on only one user profile name. The QGYOLSPL API allows filtering on multiple user profile names.
The QUSLSPL API allows filtering on only one output queue name. The QGYOLSPL API allows filtering on multiple output queue names.
The QUSLSPL API does not allow filtering on spooled file status. The QGYOLSPL API allows filtering on multiple spooled file statuses.
The QUSLSPL API does not allow filtering on printer name. The QGYOLSPL API allows filtering on multiple printer names.
The QUSLSPL API returns the list of spooled files in only one order. The QGYOLSPL API has a sort information parameter to allow sorting on one or more of the fields in the list.
<End of snippet>
Depending on your needs, you should evaluate which API is the most applicable.
Cheers,
Richard