The purpose of this node is to give non operator OS/400 users an easy way to convert a spool file into a physical file.
Situation: You write a query for an enduser and print out the results for them. 3 days later, the enduser calls back and requests the report in a file format. If you no longer have the spool file and your data is time sensitive, rerunning the query is useless. This trick will save you some pain.

1. Type WRKSPLF and hit enter. 2. Select to change the file and write down the following information:
spool file name
job name
user name
job number
spool file number
3. Cancel your change request and choose to display the file.
4. Standard OS/400 display has inch markers as a ruler over the display. The distance between two markers represents 10 characters. Roughly guess the maximum length in characters of the report and write it down with the rest of the information.Remember, It is better to overestimate.
5. At the command line, type CRTPF and hit enter.
6. Change the name and the library to where you would like your physical file placed.
7. Hit F10 and pagedown once. Change the record size to the size you wrote down in step 4 and hit enter.
8. type CPYSPLFand hit enter.
9. Enter in all the information you obtained in step 2.
10. Enter in the name and library of your new file.
11. Change the only occurence of "*REPLACE" to "*ADD" and hit enter.

You now have an exact replica of your spool file in a physical file. If need be, you could delimit the file using steps found in this node.

If you want to transfer the newly converted file over to a PC via Client Access ODBC, make sure you have the "Translate CCSID xxxx" option enabled for your data source. Otherwise the file will come over the line as garbage.

Log in or register to write something here or to contact authors.