Author Topic: Retrieving spool files  (Read 671 times)

rajesh_400

  • Jr. Member
  • **
  • Posts: 16
    • View Profile
Retrieving spool files
« 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!

Darrell Bryant

  • Jr. Member
  • **
  • Posts: 66
  • Sed fugit interea fugit inreparabile tempus-Virgil
    • View Profile
Re: Retrieving spool files
« Reply #1 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?
#IBMi #iSeries #PDF #XML #400 Indexer #ASM

rajesh_400

  • Jr. Member
  • **
  • Posts: 16
    • View Profile
Re: Retrieving spool files
« Reply #2 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.

Justin Derrick

  • IBM Content Manager OnDemand Consultant
  • Administrator
  • Hero Member
  • *****
  • Posts: 2029
  • CMOD Guru for hire...
    • View Profile
    • Tenacious Consulting
Re: Retrieving spool files
« Reply #3 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.
IBM CMOD Professional Services: http://TenaciousConsulting.com
Call:  +1-866-533-7742  or  eMail:  jd@justinderrick.com
IBM CMOD Wiki:  https://CMOD.wiki/
FREE IBM CMOD Education & Webinars:  https://CMOD.Training/

Interests: #AIX #Linux #Multiplatforms #DB2 #TSM #SP #Performance #Security #Audits #Customizing #Availability #HA #DR

Darrell Bryant

  • Jr. Member
  • **
  • Posts: 66
  • Sed fugit interea fugit inreparabile tempus-Virgil
    • View Profile
Re: Retrieving spool files
« Reply #4 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.
« Last Edit: June 09, 2020, 11:38:04 AM by Darrell Bryant »
#IBMi #iSeries #PDF #XML #400 Indexer #ASM

rajesh_400

  • Jr. Member
  • **
  • Posts: 16
    • View Profile
Re: Retrieving spool files
« Reply #5 on: June 09, 2020, 10:02:37 AM »
Thanks Bryant ,JD!!