Extract Jobs from Hercules local printer

It is so much easier to look at MVS Job output locally on Linux (taking into account the choices of tools and editors available) than on the TSO, 80 column 3270 terminal. If you specify MSGCLASS=A in your JCL your output gets sent to the Hercules local prt subdirectory. However Hercules just appends each output onto the end of the previous Job. So…I wrote a Python 3 program that reads the Hercules local prt00e.txt & prt00f.txt output on Linux which contains multiple jobs, back to back, and splits each job out to it’s own file. There are more sophisticated ways of doing this on MS-Windows but I was unaware of anything that does this on Linux. It opens the print file, read-only and can run while Hercules is active. There is maybe a likelihood that there could be problems (but not to the Hercules prt files) reading while Hercules is writing. So it’s probably best to run between Job execution.

Extracted files are named “JobNo-JobName (date&time).txt”

I had to add date & time because some Jobs with the same Job Name & Job Number appear multiple times. Such as the “MF1” job that runs on the TK4 system. It can be cancelled BTW! I usually do if I remember.

It’s fast too…
Read a 7+MB file with 80322 lines and wrote (extracted) 42 files (jobs) in less than a second.

parseJob Output

There’s a possibility that I might revisit some work I previously did creating the nostalgic greenbar look. I could combine it with or add a option to this program. It’s certainly not high on my to do list. See this post for an example or search for greenbar for other examples of work I did on this, which also show some bluebar. Still needs much work though!