Find if a spool file exists

pts.
Tags:
RPGLE
Using RPG, how to find if a spool file exists. I would like to pass spool file name and job details as parameters to RPG program.

Answer Wiki

Thanks. We'll let you know when a new response is added.

In your RPG program you can place a call to the QUSRSPLA system API to try and retrieve the attributes of the spool file. If nothing is returned in the error data structure for the API then the spool file exists, if an error is returned then the spool file could not be found.

I don’t have an RPG example available for this API, but I do have a CL program example that accepts the spool file name and job details and returns an indicator to identify whether or not the spool file exists.

The source for the CL program can be found at:

http://www.astradyne-uk.com/code/index.php?id=0bebfeadda

It shouldn’t be difficult to convert the method into RPG and create a sub-procedure you can add to your toolbox.

All the best

Jonathan

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following