OnDemand User Group

Support Forums => iSeries => Topic started by: rajesh_400 on June 08, 2020, 12:39:27 PM

Title: Retrieving spool files
Post by: rajesh_400 on June 08, 2020, 12:39:27 PM
Hello Everyone,

We have a request to retrieve spool files from ondemand 10.1. I tried using arsdoc print and prtrptond and both of them retrieves the spool files to an outq. I want the reports to be generated to an IFS location. How can I do that? ( I can copy the spools to ifs files).

For pdf files, i tried using arsdoc get and can able to successfully get them to ifs location. So, is there any better way to do it?

Thanks in advance!
Title: Re: Retrieving spool files
Post by: Darrell Bryant on June 08, 2020, 01:50:22 PM
There are two methods to retrieve data stored in Content Manager OnDemand for i and put that data into an IFS file.

1) arsdoc get
2) RTVDOCOND (an IBM i user friendly front end to arsdoc get that covers all the popular arsdoc options)

Are you planning to reload the data into another system or to send it to some type of client application?
Title: Re: Retrieving spool files
Post by: rajesh_400 on June 08, 2020, 06:58:11 PM
Hi Darrell,

Thank you for prompt response. This is a request to extract the Spool files (with IND if possible) . I tried retrieving spool files with arsdoc get. It generated .ind and .out files. But, .out file data is not valid when tried to view in notepad.
Title: Re: Retrieving spool files
Post by: Justin Derrick on June 09, 2020, 06:38:37 AM
Probably needs to be converted from EBCDIC to ASCII.

Or if the data is in AFP format, you'll need to view it with AFP workbench.

-JD.
Title: Re: Retrieving spool files
Post by: Darrell Bryant on June 09, 2020, 06:44:19 AM
There is no built in method to retrieve spooled file data from the server and store it in a flat (text only) file. When data is retrieved using arsdoc get or RTVDOCOND, it is assumed that the data will either be reloaded into another server or viewed using a client appropriate for the data type.

If you retrieve the data to a spooled file, you can copy it to a stream file using CPYSPLF, for example:
CPYSPLF FILE(CKS) TOFILE(*TOSTMF) JOB(006123/DBRYANT/QPRTJOB) SPLNBR(54) TOSTMF('/home/dbryant/cks.txt')
The stream file will be encoded in EBCDIC (the CCSID of your job).

If you need the stream file in ASCII, these steps will work (set the CCSID to whatever value you require). (Note that Notepad would still not display the file correctly for me, even when encoded in ASCII.)
QSH CMD('touch -C 819 /home/dbryant/cks2.txt)
CPYSPLF FILE(CKS) TOFILE(*TOSTMF) JOB(006123/DBRYANT/QPRTJOB) SPLNBR(54) TOSTMF('/home/dbryant/cks2.txt') STMFOPT(*REPLACE)

You can also convert to PDF using CPYSPLF, for example:
CPYSPLF FILE(CKS) TOFILE(*TOSTMF) JOB(006123/DBRYANT/QPRTJOB) SPLNBR(54) TOSTMF('/home/dbryant/cks.pdf') WSCST(*PDF)

More information on the using CPYSPLF to a stream file can be found at:
https://www.ibm.com/support/pages/new-cpysplf-function-copy-splfs-stream-files-ifs

In addition to arsdoc print and PRTRPTOND, there is also a PRTDOCOND command, which has more flexibility than PRTRPTOND.
Title: Re: Retrieving spool files
Post by: rajesh_400 on June 09, 2020, 10:02:37 AM
Thanks Bryant ,JD!!