Interpreted CL Members, Take 2
April 11, 2012 Ted Holt
Once again, the alert and astute readers of this august publication have proven true the old adage that multiple methods exist for removing the outer covering of a feline animal. Several of you wrote in response to my article, Interpreted CL Members, to share other methods of running CL commands in interpreted mode. Here are some of the comments I received.
I use REXX to handle scripting for CL commands. While I’m not an expert, I’ve found it useful for tasks that you do at a command line to set up something, do over and over, and forget the sequence. I use CL within REXX for certain system functions, such as building a member to re-create data areas and then assign them authorities. So I just F9 back through my command line and paste my commands into a REXX script.
REXX is an amazing tool, Russ, but I’ve never become an expert at it either.
What about using the Start Database Reader (STRDBRDR) command with a source member like this one:
//BCHJOB JOB(jobname) JOB(jobdescription) ... more CL commands //ENDBCHJOB
I think SBMDBJOB is easier than using a reader, but that works, too. If any of you use readers, I’d like to hear how you use them.
I have a tool that will interpret a CL member interactively. You can get it at here.
It takes each line in a source member, sends it to *EXT as a *RQS, and then calls QCMD. I wrote this 25 years ago, and it is a rare day that I don’t use it This site, www.brilligware.com has a number of tools and utilities, emphasizing ILE/RPG and /free.
Thanks for sharing your utility with us, Chris.
I wanted to mention three alternatives to interpreting commands.
1) If your reader has TAA Tools installed, he can use the EXCCMD command, which does exactly what he wants, without any of the input spooling directives.
2) Use REXX. This is what I do. This allows a lot of flexibility and readability.
3) Your reader could also use RUNSQLSTM, placing the CL commands on lines beginning with “CL:”. (Don’t forget to put a semicolon at the end of the command.) I don’t use this method for pure CL, but sometimes I need CL to support my SQL statements (such as an RGZPFM on a table I just loaded, for example).
Thanks to all who wrote.
Keep the feedback coming, folks. I learn a lot from you.