...
The CL source files are compiled and bound with the following command:
...
Html bobswift |
---|
<pre>
CRTBNDCL PGM(UNVPRD511/exitname)
SRCFILE(UNVPRD511/UNVCLSRC)
SRCMBR(exitname)
</pre>
|
|
Change the exitname to the name of the exit to be compiled and bound. UCMSJOBI
The
UCMSJOBI exit is called before any user command is executed. This exit can be used to customize the job's environment to meet local requirements. It executes under the user profile requested by the Manager. If the exit issues unhandled messages with a severity greater than or equal to the value of the UCMD Server
END_SEVERITY option, the job will terminate without executing any user commands.
...
For example, the following command sends the text "'Change current library to ABC" to standard output and changes the current library:
...
Html bobswift |
---|
<pre>
ucmd -c "say 'Change current library to ABC'; \"CHGCURLIB CURLIB(ABC) \"" -i as400 -u qsysopr -w qsysopr -cmd_type rexx
</pre>
|
|
A user may use a simple REXX program in this context to setup and execute programs on the IBM i. REXX provides the benefit of using standard output (STDOUT) and standard input (STDIN) files as part of their environment. The SAY command writes to STDOUT and the PULL command reads from STDIN.
...
For example, the following line is sufficient to indicate a REXX EXEC file:
Panel |
---|
Html bobswift |
---|
<pre>
/* REXX */
</pre>
|
|
REXX EXECs have the benefit of using standard output (STDOUT) and standard input (STDIN) files as part of their environment. The SAY command writes to STDOUT and the PULL command reads from STDIN.
...
For example, the following UCMD Manager command can be used from Windows or UNIX to request execution of the command reference
cref100 and pass it options
opt1 and
opt2:
...
Html bobswift |
---|
<pre>
ucmd -c "cref100 opt1,opt2" -cmd_type cmdref ...
</pre>
|
|
IBM i command references can define command types
cmd and
rexx.
For a complete discussion of Command References, see
Command References.
...
To use this
cmdref, invoke UCMD Manager using:
...
...
Anchor |
---|
1050453 | 1050453 Panel |
---|
Html bobswift |
---|
<pre>
ucmd -c "cmdref_cmd" -cmd_type cmdref -u xxxx -w zzzz -i as400
</pre>
|
|
In this case, the user (xxxx) has authority to call the IBM i system object QWCRJBST and cmdref_cmd is the name of the command reference file on the IBM i.
Panel |
---|
Html bobswift |
---|
<pre>
# -- File named cmdref_cmd in library UNVCMDREF --
# Use USBMJOB to execute the DSPLIB command.
#
-format cmd
-type cmd
</pre>
|
<eof>
Html bobswift |
---|
<pre>
usbmjob cmd(dsplib qsysopr)
</pre>
|
|
The next command reference contains a series of four commands which are executed in sequence from top to bottom. Invoke these commands from system as4test using: Panel |
---|
Html bobswift |
---|
<pre>
ucmd -c "cref_test" -cmd_type cmdref -u xxxx -w zzzz -i as4test
</pre>
|
|
In this case, the user (xxxx) has authority to call the IBM i system object QWCRJBST and cref_test is the name of the command reference file on the IBM i.
Panel |
---|
Html bobswift |
---|
<pre>
# -- File named cref_test in library UCVCMDREF --
# Execute a series of commands. The output of the first two will remain
# on the output queue associated with the job's printer. The output of
# the second two (by means of USBMJOB) will be directed to standard output
# and sent to the system running the Universal Command Manager.
#
-format script
-type cmd
</pre>
|
<eof>
Html bobswift |
---|
<pre>
DSPUSRPRF USRPRF(QUSER)
dspcurdir
usbmjob cmd(dsplib quser)
usbmjob cmd(dsplibl)
</pre>
|
|
REXX Command Reference Example The following command reference sends the message and the library catalog to standard output. The job logs are sent to standard error. To invoke this cmdref on system denver, use: Panel |
---|
Html bobswift |
---|
<pre>
ucmd -c "rexx_test" -cmd_type cmdref -u xxxx -w zzzz -i denver
</pre>
|
|
In this case, the user (
xxxx) has authority to call the IBM i system object
QWCRJBST and
crefrexx_test is the name of the
command reference file on the IBM i....
command reference file on the IBM i.
Once again, the user, designated by the -u option, requires access to the object QWCRJBST. Without this access, usbmjob will fail.
Panel |
---|
Html bobswift |
---|
<pre>
# -- File named rexx_test in library UCVCMDREF --
# Use USBMJOB to execute the DSPLIB command.
#
-format script
-type rexx
</pre>
|
<eof>
Html bobswift |
---|
<pre>
say "Submitting job to display library qsysopr"
'usbmjob cmd(dsplib qsysopr)'
</pre>
|
|