Blog Archive

AS400 - Spooled File in job *// number *LAST not found

Most of you might have come across this error in iSeries and basically it tells you that the spool file with that name doesn't exist. But what if the spool file really exists and you are still getting this error. This happened to me several times and its a pretty easy fix but I always forget.

It happens in cases when the Job changes User profile as in the case of a JDBC connection. In my scenario the Java program was making a call to CL program using a stored procedure that will print a spool file and then convert it to a PDF and return it to the requesting party. When we called the stored procedure from STRSQL in AS400 it worked fine but when called from the Java program it failed to find the Spool file giving the following message.

Message ID . . . . . . : USR8431
Message type . . . . . : Diagnostic
Message . . . . : Spooled File S123456789 in job *// number *LAST not found

The solution is very simple. All you have to do is to change your OVRPRTF command with SPLFOWN(*JOB).

What is does?
  • The spooled file is owned by the original user profile of the job. If the job has switched to a new user profile, the original user profile is still the owner of the spooled file.