Handy dandy Hercules submit script

Well doesn’t exactly submit, but makes it much easier to do so. Since I prefer to code locally, I wrote Python CLI program ‘toherc’ that takes a file name and depending on file extention (jcl, cob, asm, aws) creates the correct devinit command and automatically places it into the clipboard, ready to paste into the hercules console. So for example if I have a file named LISTVTOC.JCL in the /Mainframe/MVS/ directory I just type toherc LISTVTOC.JCL and it puts “devinit 00c /Mainframe/MVS/LISTVTOC.JCL” in the clipboard. If I have a tape file named CUST-TAPE.aws in the tape/ directory I just type toherc CUST-TAPE.aws and it puts “devinit 480 tapes/CUST-TAPE.aws” in the clipboard. Then you just go to the Hercules console and Paste then press Enter! Wa-la or properly…voilĂ .

Some may just put everything in Hercules ‘jcl’ sub directory, so this may seem like overkill, however that doesn’t fit my workflow. I like to split things into various random sub-directories, perhaps, COBOL, Assembler, JCL etc. within a mainframe folder and these may also be subdivided especially if you use git. It’s small and I originally just copied it to the directory where my files were but for the reasons I just mentioned, I installed it in to /usr/local/bin/toherc on my system, so it can be run anywhere.

Tip: if you press the up arrow on the Hercules console it will retrieve previous Hercules (Not MVS) commands (devinit is a Hercules command). Therefore if you fix a JCL or program error locally, in Linux and save, then you only need to retrieve the previous command and press Enter to rerun. Easy Peezy.