...
The CL source files are compiled and bound with the following command:
Panel |
---|
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.
...
For example, the following command sends the text "'Change current library to ABC" to standard output and changes the current library:
Panel |
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.
...
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:
Panel |
html-bobswift |
---|
<pre>
ucmd -c "cref100 opt1,opt2" -cmd_type cmdref ...
</pre>
|
IBM i command references can define command types
cmd and
rexx.
...
To use this
cmdref, invoke UCMD Manager using:
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
...
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
rexx_test is the name of the 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>
|