Export an iSeries SPOOL FILE to a PDF file

Looking for an example project to get you started?

Export an iSeries SPOOL FILE to a PDF file

Postby Support_Julie » Wed Mar 31, 2010 8:38 am

Q.
Can we use GoAnywhere Director to export an iSeries SPOOL FILE to a PDF file?

A.
GoAnywhere Director cannot convert a spool file to a readable PC format.
However, SURVEYOR/400 (By Linoma Software) will convert a spool file to a PDF or TXT file. The Surveyor command EXPSPL can be ran from a GoAnywhere Director project.
Surveyor/400 will need to be installed on your iSeries in order for this project to work.

The following variables are defined in this project:

Variable Name............Default Value
JobName....................*ALL
JobUser..................... *CURRENT
JobNumber................. "000000"
SpoolFileNumber........... *LAST
DestFileName.............. /tmp/myfile.pdf

For this to work you will need to fill in the proper values for your job and spool file number.

Copy the following XML code to a text file. Save it to a file named SpoolFile.XML From the GoAnywhere project menu, you will be able to IMPORT the project.
The project emails the PDF file that is created.


Code: Select all
<project name="SpoolFile" mainModule="Main" version="1.0" logLevel="debug">
   <variable name="JobName" value="*ALL" />
   <variable name="JobUser" value="*CURRENT" />
   <variable name="JobNumber" value="000000" />
   <variable name="SpoolFileNumber" value="*LAST" />
   <variable name="DestFileName" value="/tmp/myfile.pdf" />

   <module name="Main">

      <exec400 version="1.0" resourceId="DEV 54">
         <command>
            <![CDATA[SURVEYOR/EXPSPL
JOB(${JobNumber}/${JobUser}/${JobName}) SPLNBR(${SpoolFileNumber})
NAMEFORMAT(*SINGLE_FILE_NAME) IFSDEST('${DestFileName}') FILTEROV(*YES)
USEMSG(*YES) OUTPUT(*NONE) JAVAER(1.5)
]]>
         </command>
      </exec400>


      <sendEmail version="2.0" resourceId="e-mail server"
toList="to@example.com">
         <from address="from@example.com" />
         <subject>
            <![CDATA[Spool file]]>
         </subject>
         <message>
            <![CDATA[Attached is your spool file.

Job Name:                ${JobName}
  User:                      ${JobUser}
  Number:                 ${JobNumber} 

Spool File Number:    ${SpoolFileNumber}]]>
         </message>
         <attachment file="${DestFileName}" />
      </sendEmail>

   </module>

   <description>export spool file with Surveyor/400 EXPSPL to IFS</description> </project>




This is the an example of what you would use for your CL. Here, we pass
values to overwrite the default variables in the project.
If the variables are not overwritten, the project will use the default settings.

GOANYWHERE/RUNPROJECT PROJECT('/test/SpoolFile') VARIABLE((JobName
QPADEV000G) (JobUser JSMITH) (JobNumber 178655) (SpoolFileNumber 000002))
Julie
Software Support
Linoma Software
Support_Julie
Support Specialist
 
Posts: 75
Joined: Thu Mar 05, 2009 3:49 pm
Location: Ashland, NE USA

Return to Example Projects

Who is online

Users browsing this forum: No registered users and 1 guest

cron