:Run Command [RU/:R]
Executes a program without leaving Qedit; returns to Qedit when done.
:RUN[ progfile ] [ ,entrypoint ] [ ; ]
[ STACK words ]
[ MAXDATA words ]
[ DLSIZE words ]
[ LIB [G|P|S] ]
[ PARM value ]
[ DEBUG ]
[ LMAP ]
[ [NO] HOLD ] {suspending programs}
[ NOPRIV ]
[ NOCB ]
[ INFO "string" ]
[ STDIN file ]
[ STDLIST file ]
[ PRI CS | DS | ES ]
[ QINPUT filename ]
[ NOSTOP ]
[ XL "filelist" ]
[ UNSAT procname ]
(Defaults: progfile = $oldpass;
see Set Lib for Lib;
Parm value = 0;
Info string = null)
The parameters to :Run are the same as in MPE. The main difference is that, in Qedit, all of the parameters are optional, the parameters can be shortened, and commas and semicolons are only needed when they hold the place of a missing parameter. Here are the :Run parameters:
progfile | PROG file to “run”; created by rep command; if missing, the default is $oldpass (from last rep). |
entrypoint | where to start execution in the program. |
STACK | reserves a specified amount of dynamic stack from the start. |
MAXDATA | specifies the maximum size the stack can grow to. |
DLSIZE | specifies the initial size of DL-DB area of stack. |
LIB | specifies which SL files to search (G, P, and/or S). The default for this parameter is normally S (system), but Set Lib can establish G or P as the default within Qedit. |
PARM | specifies a parameter to pass to the program; the value must be between -32768 and +32767. |
DEBUG | invokes the program in the Debug utility. |
LMAP | prints map showing where each external procedure is “loaded” from; list file name is LOADLIST. |
NOHOLD | if the program should try to suspend on exit, kill it anyway. Useful for test versions of programs. Always creates a new process; without NOHOLD, :Run will awaken a held son process instead of creating a new one. |
HOLD | if the program should suspend on exit, hold onto it without asking and kill off the least-recently used Hold process if there are more than the Set Limit Hold value. If there is already a held program with the same name, entrypoint, and PARM value, activate it instead of creating a new process. |
NOPRIV | see the MPE manual for this parameter. |
NOCB | see the MPE manual for this parameter. |
INFO | passes a string to the program as a parameter; either double quote (“) or single quote (‘) is allowed as string delimiter, but embedded quotes are not allowed; the Info= string is upshifted if you use ‘string’, but not if you use “string”. |
STDIN | specifies redirection of $stdin file. |
STDLIST | specifies redirection of $stdlist file. |
PRI | execute the program at the priority specified. |
QINPUT | open *filename and pass it to the program, using a message file for Qedit workfiles. |
NOSTOP | continue editing in Qedit while the new program is running. Will not work if the program uses Control-Y or does terminal I/O. |
XL | list of XL files to search for MPE/iX programs (in quotes). |
UNSAT | procedure name to use for all unsatisfied external references. Quotes are optional but accepted. Works only on MPE/iX. |
Examples
/run {run $oldpass with defaults} /ru spook.pub.sys;hold {hold onto spook} /ru pf m 5000 de {:run pf;maxdata=5000;debug}
Breaking a Program
If a program that you are testing from within Qedit should go into an infinite loop, you can stop it by striking the “break” key. MPE responds with a colon prompt (:), unless you have “break” disabled in your program. The :Abort command kills the program, but it also stops Qedit, and you must run Qedit again.
Suspending a Program
If you run a program that “suspends” instead of terminating, what Qedit does depends upon whether you specified the Hold keyword or the NOHOLD keyword or neither. With NOHOLD, Qedit kills the program. With Hold, Qedit saves the program and, if more programs have been saved than allowed by Set Limit Hold, kills the least-recently used one. If neither Hold nor NOHOLD was specified, Qedit asks if you would like to Hold the program. When you next :Run that program, Qedit merely activates the held process. You must :Run it with the same entrypoint and PARM value to reactivate the program. If you :Run the program a second time, but specifying NOHOLD, Qedit creates a second process. It is much faster to activate than to create. Programs run with Stdin=, Stdlist=, or Qinput= cannot be held.
Programs that suspend on exit include SPOOK, SUPRTOOL, and EQUATER. (SPOOKsters note: Exit does not release the current spool file; use Text with no parameter before Exit for that purpose.)
To see what programs you have held, use Verify Run. To enter one of your held programs, use :Run with the full program name, entrypoint name, and Parm= value (unless zero). Qedit looks first in the Hold table before it creates a new copy of the program. If Qedit finds the program there, it just activates the existing copy, which is faster. Or, :Activate with a subset of the program name and entrypoint (i.e., :A SU to activate Suprtool.Pub.Robelle). Any or all of the Hold programs can be killed with the :Kill command.
The Set Check Hold Yes option configures a default answer to the “Okay to Hold?” question of the Run command. Possible values are “YES” (always hold), “NO” (never hold; same as Set Limits Hold 0), and “ASK” (ask users if they want to hold each process, which is the default).
Feeding Qedit Files to Programs
Qinput feeds Qedit workfiles into programs that won’t read them (e.g., DBSCHEMA). For “unnumbered” input lines, use Set Lang Text, JOB or RPG. You must have a :File equation for the specified filename (i.e, don’t specify the actual file name in the :Run command). Qinput processes Include files as well, but if it cannot open the file it passes the Include line to your program for processing (#include <stdio.h> ). :Reset filename command is done at the end. See also the Qedify program under Installation.
:file dbstext = xxxx :file dbslist =$stdlist :run dbschema.pub.sys;parm=3;qinput=dbstext
Rese
tting EOF on $Stdin
When you have more than one program running on the same terminal, some unusual problems can occur. One problem has to do with end-of-file on $stdin and $stdinx. If you are running SPOOK from inside Qedit (or :Segmenter or any other program that reads from $stdin) and you try to type an MPE command such as :Listf, the program terminates with an END OF FILE warning. And, if you try to run the program again, you get the same warning and nothing will be read from the terminal. To reset EOF on $stdin, use /:Stream with no parameters. MPE attempts to read a job stream from the terminal, encounters the EOF, and resets it. You can then run your program again.