VM/370 printouts

How do we do that?

So, as you can see, I also managed to get VM printed output translated to PDF. This was a lot more of a hassle than with MVS, because other than MVS, VM/370 – in the version we run on Hercules – does not spit out job separators at the end. It’s just al content. Last line printed; boom, end of job.

And this presents a problem because the output stream from Hercules remains open until the emulated OS closes and Hercules shuts down. So, after a print job is at it’s end, Hercules just stops sending records. Makes sense right? But when it does not close the file, we cannot detect the end of the job to be printed, like we could with MVS by checking for the END separator.

VM specific work

Automation; a script

Because VM behaves different from MVS I had to come up with my own solution for a job splitter program. You may use it, I published the source on Github.

I made a prtpdf script and altered it to suit my VM needs. The script will take all .txt files it finds in the specified directory, convert them to pdf files and delete them when done. The names of the constructed pdf files are derived from the starting VM separator page and will look like NNNN-MMMMMMMM.pdf where:

  • NNNN is the jobnumber
  • MMMMMMMM is the jobname

This is done by the prtpdf_vm script (see above, from Github). To continue, follow the README instructions from Github to install the files where they need to be. Then return back here to finish. Read the README, it’s good for you!

————— Waiting for you to install from Github —————

Two ways

Now, the newly installed program can be used in two ways:

Process existing output

We can use it to process already existing output that will be in one big file for a given printer (something like ‘prt00e.txt’). When we give it this command:

cat prt00e.txt | gawspool_vm ./

it will go through the file prt00e.txt and split it up into separate .txt files in the given directory (in this case ./). It does that by searching until it finds the End-print-job separator we inserted in CMS, after which it will split the file and start a new one. After it is finished we have a series of .txt files in the designated directory. We then can use our scripts to convert them to pdf’s.

Process S/370 output

To catch every job from VM we have connected the 000E printer to gawspool_VM and then let it have execute our script at the end. Then we will have automated our printing to PDF!