Export an iSeries SPOOL FILE to a PDF file

Looking for an example project to get you started?
3 posts Page 1 of 1

Support_Julie

User avatar
Support Specialist
Posts: 87
Joined: Thu Mar 05, 2009 3:49 pm
Location: Ashland, NE USA

Post by 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) 
]]>
			</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 Rosenbaum
Sr Support Analyst
e. goanywhere.support@helpsystems.com
p. 1.800.949.4696
w. HelpSystems.com

bpitzke

Posts: 1
Joined: Tue Sep 01, 2015 8:02 am

Post by bpitzke » Tue Sep 01, 2015 8:33 am
I have tried unsuccessfully to do this..the project will override my variables to the correct values:
Overriding variable 'JOBNUMBER' with value '466338'
Overriding variable 'JOBUSER' with value 'LUELOFF_K'
Overriding variable 'SPOOLFILENUMBER' with value '000001'
Overriding variable 'JOBNAME' with value 'IC0620'
But when it executes the surveyor command it fills in the default values
SURVEYOR/EXPSPL JOB(000000/*CURRENT/*ALL) SPLNBR(*LAST) NAMEFORMAT(*SINGLE_FILE_NAME) IFSDEST('/tmp/myfile.pdf') FILTEROV(*YES) USEMSG(*YES) OUTPUT(*NONE)

Can you please help?

Support_Rick

Support Specialist
Posts: 592
Joined: Tue Jul 17, 2012 2:12 pm
Location: Phoenix, AZ

Post by Support_Rick » Wed Sep 28, 2016 9:57 am
Can you send me a copy of your Project XML and full job log?
Rick Elliott
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696
3 posts Page 1 of 1