Accessing Spooled Files


Spooled File Support

The server supports returning formatted data from spooled files. By default the server maintains the spooled file's line spacing, bold attributes, and underline attributes.

Spooled files can also be copied into and returned formatted from database files.

Specifying a URL

The server supports three general formats of URLs that access spooled files:

http://server:port/splf/jobname/user/jobnbr/splfname

or

http://server:port/splf/jobname/user/splfname

or

http://server:port/splf/jobname/jobnbr/splfname

where,

server
is the fully qualified domain name of the machine that contains the resource.
port
is the socket port on the host machine that is running the HTTP server. The :port is optional. If it is not included, it defaults to port 80.
splf
indicates that the data is contained in a spooled file on the AS/400.
jobname
the name of the job that created the spooled file.
user
the user name that identifies the job's user profile. If the user is not supplied then the job number must be passed. If the user is not passed then the URL may not uniquely identify the spooled file which will result in an error being returned. The WRKJOB JOB(jobname) command can be used to identify all the jobs in the system with the specified jobname.
jobnbr
identifies the job's job number. If the job number is not supplied then the user must be passed. If the job number is not passed then the URL may not uniquely identify the spooled file which will result in an error being returned. The WRKJOB JOB(jobname) command can be used to identify all the jobs in the system with the specified jobname.
splfname
specifies the name of the spooled file. By default the job's last spooled file with the specified name is returned. The SPLNBR keyword parameter can be used to retrieve a specific spooled file.


Determining Content Type

The content type indicates the type of data that is being returned from the server to the browser. Spooled files will normally contain plain text.

The following order is used to determine the content type of data stored in a spooled file:


Authority

The server user profile must meet one or more of the following conditions to access the spooled file:


Supported Keywords

The following keyword parameters are supported when processing spooled files:

SPLNBR(number | *LAST | *ONLY)
The spool number is used to identify a specific spooled file. Valid values are:

If the SPLNBR keyword is not supplied then the server defaults to SPLNBR(*LAST).

Samples:

SPLF(0 | 1)
Used to specify output formatting for the spooled file. Valid values are:

If the URL indicates the spooled file contains HTML data then either option can be specified and the data is returned as is from the spooled file. Non-text content types will return the spooled file data with the printer control characters.

If the SPLF keyword is not supplied then the server defaults to SPLF(0).

Samples:

HEADER(library/src-pf member[.html])
Used to specify a header document to include before the spooled file data. A header can be used to set the document title and describe the spooled file data that follows.

The first part of the header keyword value indicates the library and source physical file that contains the member containing the header information. The slash separating the library and src-pf should be escaped (e.g., / = %2F). The library specified must be accessible through the configured include libraries. The second part specifies which member contains the header data. The data contained in the member is assumed to be plain text unless one of the following two methods is used to indicate the member contains HTML data:

  1. .HTML is appended to the member name
  2. Member type is set to HTML

Samples:

FOOTER(library/src-pf member[.html])
Used to specify a footer document to include after the spooled file data. A footer can be used to display summation information.

The first part of the footer keyword value indicates the library and source physical file that contains the member containing the footer information. The slash separating the library and src-pf should be escaped (e.g., / = %2F). The library specified must be accessible through the configured include libraries. The second part specifies which member contains the footer data. The data contained in the member is assumed to be plain text unless one of the following two methods is used to indicate the member contains HTML data:

  1. .HTML is appended to the member name
  2. Member type is set to HTML

The footer should not include either the <HTML> or <BODY> tag.

Samples:

PAGES(start-end)
Used to specify which spooled file pages are to be returned.

The format of the PAGES keyword value is the starting page number followed by a hyphen and then the ending page number. If the starting page number is greater then the total number of spooled file pages then no spooled file data is returned. The ending page number may be set to the special value *LAST. The starting and ending page values are inclusive.

If PAGES is not specified then all of the pages will be returned.

Samples:

SENDLEN(0 | 1)
Used to specify if the content length should be sent. Using the SENDLEN keyword overrides the send file content length configuration value. Valid values are:

Samples:


Output Considerations

Document Title
The title of the document (i.e., spool file) returned is set to the second-level message text of message ID (WWW0913 - formatted spool file output, or WWW0914 - preformatted spool file output) in the WWWMSGF message file. If a different default title is desired then change the second-level message text. If the spool file contains HTML data then the spool file should set the document title.


Restrictions

Graphic, binary, and bar code data contained in a spooled file is not returned by the server. If data is defined using the DFNCHR or TRNSPY keywords the data is replaced with blanks.


Examples

The following are examples of URLs that access spooled files:
http://system/splf/dsp01/user/123456/splf
The URL fully identifies a spooled file named SPLF.

http://system/splf/dsp01/user/splf
The job number is not needed to identify the spooled file.

http://system/splf/dsp01/123456/splf
The user is not needed to identify the spooled file.

http://system/splf/dsp01/user/123456/splf?SPLNBR(3)
The URL fully identifies a spooled file. The spooled file SPLF with a number of 3 is returned.

http://system/splf/prtdoc/user/123456/office?SPLF(1)
The URL fully identifies a spooled file named OFFICE. The OFFICE spooled file contains a letter which is returned with a variable font.

http://system/splf/prtdoc/user/123456/report.html
The URL fully identifies a spooled file named REPORT. The REPORT spooled file contains HTML data.