LAST_SPLF

LANSA Composer

LAST_SPLF

This activity retrieves the identity of the last spooled file created for the current job.  This activity is only supported on IBM i servers.

You might use this activity after executing another activity that you expect will have created a spooled file in the current job.  For example, executing certain system commands (using the SYSTEM_COMMAND activity), a custom activity or calling a program or LANSA function may create a spooled file.

Note that this activity will ONLY retrieve the identity of a spooled file created in the same job that executes the LAST_SPLF activity.  This means that there are several common circumstances in which this activity will NOT yield the desired information.  For example:

  • spooled files generated as a consequence of executing a LANSA Integrator service command
  • calling a LANSA function, if the request is satisfied through the LANSA Composer Request Server

(You may use the SPLF_LIST activity to list spooled files created in another job or by another user.)

You should check that the spooled file is the one you expect before processing it further - for example, you might at least test that the SPLFNAME value is the spooled file name that you expect.

Note that in some circumstances (in particular when the current job's user name is not the same as the current user profile), the job details for the spooled file will not match the job name, user name and job number for the current job.  For example, you may find that a job named QPRTJOB owns the spooled file.  You should use the details provided by this activity or by the SPLF_LIST activity if you wish to perform further operations on the spooled file.

If no last spooled file information is available, the output parameters will be empty.  The activity ends normally (without error) in this case.

INPUT Parameters:

There are no input parameters for this activity.

OUTPUT Parameters:

JOBNAME:

If successful, this parameter will contain the name of the job that owns the spool file.

JOBUSER :

If successful, this parameter will contain the user profile name of the job that owns the spool file.

JOBNUMBER :

If successful, this parameter will contain the job number of the job that owns the spool file.

SPLFNAME :

If successful, this parameter will contain the name of the spool file.

SPLFNUMBER :

If successful, this parameter will contain the number of the spool file.