How to Set Up Command Files [ Information Access Server: Database Administration ] MPE/iX 5.0 Documentation
Information Access Server: Database Administration
How to Set Up Command Files
A command file consists of a series of commands (and their associated
parameters) that are executed sequentially when the file is processed.
You create a command file as a standard ASCII file using a line editor or
word processor in the non-document mode.
Ground Rules
When designing a command file, you must observe the following ground
rules:
* Enclose parameters containing embedded blanks within single or
double quotes. For example:
SQL "SELECT * FROM TABLE1"
SQL 'SELECT * FROM TABLE1'
* Allow at least one blank character or comma between each parameter
in the command line. Other delimiters will not work.
* Continue long command strings (up to 4000 characters) on the
following line by placing an ampersand (&) as the last character
on each line to be continued. The ampersand must fall between
subparameters; it cannot be placed between commands. For example:
OUTPUT_TAB ORDERS SQL &
ORDERDB '"ORDER-FILESET"'
* Place an asterisk (*) in the first position of any line you want
treated as a comment. Comment lines are ignored when the file is
processed. For example:
* This text is treated as a comment.
* Observe the following maximum character limits:
---------------------------------------------------------------------------------------
- Parameter - Limit -
---------------------------------------------------------------------------------------
- Remote table name - 16 characters -
- Search criteria - 640 characters -
- Command line - 4000 characters -
---------------------------------------------------------------------------------------
* Enclose all string constants within single quotes or double
quotes.
* Always conclude your command file with the EXIT command to clear
the job.
Capturing a Session Model
With the preceding ground rules in mind, you can begin setting up command
files to perform the tasks you require. The actual contents of the
command file will, of course, depend on what you are trying to
accomplish. The best way to get a feel for what commands are needed and
how they should be arranged is to run through the procedure and observe
what steps are involved.
You can enter the Access Server interactive batch mode to examine the
data you want to manipulate and test the various commands before
committing them to a command file. The following command will place you
in the Host Batch Facility's interactive mode:
:RUN HDPBATCH.PPC.SYS
From the batch program prompt (>), you can issue any valid batch command.
You can also issue MPE commands by prefacing them with a colon (:). For
example:
>:LISTF
This command provides a list of files in the current user group just as
it would from the MPE prompt.
Note that the RUN command is a special command that does not require a
colon before it and requires the
following special syntax:
NOTE This discussion applies only to Information Access running on
MPE/V. In Information Access on MPE/XL, the Host Batch Facility
supports the MPE :RUN command.
>RUN program [parmvalue] [infostring] [libvalue]
program -- name of a valid program to run
parmvalue -- number to be passed as the PARM= value to the program
infostring -- text string, surrounded by quotes, to be passed as the
INFO= string to the program
libvalue -- the LIB= value. Legal values are G, P, and S.
Examples.
>RUN SPOOK5.PUB.SYS
>RUN OPT.PUB.SYS 4
>RUN MYPROG.GROUP.ACCOUNT , , "AN INFO STRING" , P
>RUN MYPROG , , , G
By executing one command line at a time while in interactive mode, you
will be able to see how the various commands function with the parameters
you supply.
The process of preparing a command file can be further simplified by
turning on the RECORD facility and capturing the session in a file. Use
RECORD to specify the name of the file under which you want the session
stored:
>RECORD filename
After you have finished building a command file in interactive mode, you
can use the file generated by RECORD, with possibly a few minor
alterations, as your command file.
Testing and Fine-Tuning the Command File
Once a command file is properly set up, you can execute it with the XEQ
command from within the Host Batch Facility:
>XEQ filename
As each line is executed, the current command and any error messages are
output to the standard list device ($STDLIST), usually the terminal, or
to the ACLIST file. These messages should provide enough information to
fine-tune the command file until it works the way you want it to. A more
detailed explanation of error recovery procedures is found at the end of
this chapter, and virtually all Access Server error messages are listed
in the Information Access Server: Error Messages manual.
The Host Batch output can be redirected to a file other than $STDLIST by
setting up a :FILE equation for ACLIST. For example:
:BUILD BATCHOUT; REC=-132,10,F,ASCII;DISC=5000
:FILE ACLIST=BATCHOUT
:RUN HDPBATCH.PPC.SYS;INFO="XEQ CMDFILE"
or
:FILE ACLIST;DEV=LASERJET
:RUN HDPBATCH.PPC.SYS;INFO="XEQ CMDFILE"
NOTE The file SAMPCMD.PPCUTIL.HPOFFICE is a sample Host Batch Facility
command file. It is heavily commented and should prove useful as a
model for your command files.
MPE/iX 5.0 Documentation