SPLF_TO_TEXT

LANSA Composer

SPLF_TO_TEXT

This activity will convert the spooled file identified by the job and spool file input parameters into a text document.  The text document is written to the file name and path specified by the DOCPATH parameter.  The FORMAT parameter allows you to choose the format that is applied to the spooled file data when it is written to the text document.

Amongst other things, you may be able to use this activity to mine data contained in spooled files by combining the activity with a Transformation Map that parses and extracts information from the generated text document using the FlexText component of the mapping tool.

The implementation of this activity uses the IBM i CPYSPLF command.  Some spooled files, for example spooled files that contain only advanced function printing data stream (AFPDS) data cannot be processed by the CPYSPLF command.  Refer to IBM i documentation of the CPYSPLF command for more information.

INPUT Parameters:

DOCPATH : Required

This parameter specifies the path and file name for the text document that will be generated by this activity.  If the specified file already exists, its contents will be replaced.

JOBNAME : Required

This parameter specifies the name of the job that owns the spool file from which the text document is to be created.

JOBUSER : Required

This parameter specifies the user profile name of the job that owns the spool file from which the text document is to be created.

JOBNUMBER : Required

This parameter specifies the job number of the job that owns the spool file from which the text document is to be created.

SPLFNAME : Required

This parameter specifies the name of the spool file from which the text document is to be created.

SPLFNUMBER : Optional

This parameter specifies the number of the spool file from which the text document is to be created.  It is required only if there is more than one spool file of the name specified by the SPLFNAME parameter for the job specified.  If not specified, a default special value of *ONLY is used.  You may specify special values *ONLY or *LAST.  Otherwise specify the number of the job's spooled file that is to be converted.

DOCCCSID : Optional

This parameter allows you to specify the IBM i CCSID with which the output text document is created.

If the parameter is not specified, a default of *DEFAULT is assumed, which instructs the activity to create the output text document using the CCSID for the job in which the activity is executing.  (You can also specify the special value of *JOB which has the same effect.)

Otherwise, you should specify the numeric CCSID value required.  For example, a value of 1208 means UTF-8.  Refer to IBM i documentation for a complete list and description of the available CCSIDs.

NOTE:  the assumed or explicit CCSID is applied only when the specified output file does NOT already exist.  If the specified output file already exists and is being replaced or appended-to by this activity, then its CCSID will not be changed.

FORMAT : Optional

This parameter allows you to choose the format that is applied to the spooled file data when it is written to the text document.  You may specify one value from each of the following three groups (each value should be separated by at least one space):

1.  *SPOOLDATA | *PRTCTL | *PAGELINE

2.  *FIXED | *CSV

3.  *BLANKLINES | *NOBLANKLINES | *CONDENSEBLANKLINES

You must specify quote marks around the value(s) to distinguish them from built-in variable names.

The options in each of the three groups are described further below.  If you specify more than one value from each group, the last-specified value is effective.  If you do not specify this parameter, the default values are '*SPOOLDATA *FIXED *BLANKLINES'.

1.  *SPOOLDATA | *PRTCTL | *PAGELINE

These values specify what data items to include in each output line.  The default is *SPOOLDATA, which includes only the spooled file line contents.  Specify *PRTCTL to include skip before and space before values before each spooled file line contents.  Specify *PAGELINE to include page number and line number values before each spooled file line contents.  Note that the page and line numbers are calculated.  In some cases, they may not match exactly the page and line numbers in the original spooled file.

2.  *FIXED | *CSV

These values specify how the data items on each output line are formatted.

The default is *FIXED, which includes the data items in fixed-length columns.

For FORMAT('*PRTCTL *FIXED'), the skip before value will occupy columns 1-3, the space before value will occupy column 5 and the spooled file line contents will begin in column 7.

For FORMAT('*PAGELINE *FIXED'), the page number value will occupy columns 1-7, the line number value will occupy columns 9-11 and the spooled file line contents will begin in column 13.

Specify *CSV to have the data items output in comma-separated form instead.

For FORMAT('*SPOOLDATA'), the *FIXED or *CSV formatting values do not apply and have no effect.

3.  *BLANKLINES | *NOBLANKLINES | *CONDENSEBLANKLINES

These values specify whether blanks lines are output to the text document.  The default is *BLANKLINES which will include all blank lines that occur in the spooled file up to the last non-blank line on each page.

Specify *NOBLANKLINES to have blank lines suppressed altogether.  Note that this option does not change the generated page and line number values written for the non-blank lines (that is to say, the blank lines are still counted for this purpose).

Specify *CONDENSEBLANKLINES to have only the first in each group of consecutive blank lines written to the text document.  Again, this option does not change the generated page and line number values written for the non-blank lines (that is to say, the blank lines are still counted for this purpose).

OUTPUT Parameters:

There are no output parameters.