How to convert spool file to programs in AS/400

AS/400 Source Files
AS/400 Spool Files
Spool files
i have a file accidentally delete that file but I have contain spool file how to convert spool file to source file please give Example code in cl or rpg

Software/Hardware used:

Answer Wiki

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


TomLiotta wrote about it here:

retrieve deleted RPGLE source file

If your program is a CL program, then you can restore the source using the command RTVCLSRC, for example :


Discuss This Question: 1  Reply

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.
  • TomLiotta
    If you have a spooled file of the compile listing, the first thing I would do is use iSeries Navigator to drag/drop a copy into a PC text file. I'd want to be certain I had that extra copy in a second system for safety. Once in a PC text file, I might simply edit (another copy of) the listing to remove parts of the listing that aren't source. Depending on how big the program is, that might only take a few minutes. From a cleaned-up PC text file, you can copy it into a shared directory back on your AS/400. The CPYFRMSTMF command can then copy it into a source member. Alternatively, you could use the CPYSPLF command to copy the spooled file into a simple physical file. You might then use SQL to DELETE lines you don't want. Deletion might get rid of all lines less than the RRN() of the first source line or greater than the RRN() of the last source line. You would also DELETE lines WHERE page heading constants were found. Finally, you might CREATE VIEW that only presnted a SUBSTR() of the print lines that included the source itself. You could then copy the VIEW into a source member. Another alternative might be to use various Qshell or PASE utilities against either a spool file PC copy or the CPYSPLF physical file to clean up the listing. There are a lot of ways to do it. The way for you will depend on what you feel comfortable doing. Regardless, step #1 should be to make sure that you work with copies of the spooled file. Always keep track of the steps so you can quickly start from the beginning again. Tom
    125,585 pointsBadges:

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.

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


Share this item with your network: