Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Anchor
1050342
1050342
The CL source files are compiled and bound with the following command:


Panel
CRTBNDCL PGM(UNVPRD511/exitname)
               SRCFILE(UNVPRD511/UNVCLSRC)
               SRCMBR(exitname)

Anchor
1050360
1050360
Change the exitname to the name of the exit to be compiled and bound.

...

Anchor
1050388
1050388
For example, the following command sends the text "'Change current library to ABC" to standard output and changes the current library:

Panel

...

ucmd -c "say 'Change current library to ABC'; \"CHGCURLIB CURLIB(ABC) \"" -i as400 -u qsysopr -w qsysopr -cmd_type rexx

Anchor
1050390
1050390
A user may use a simple REXX program in this context to setup and execute programs on the IBM i.

...

Anchor
1051187
1051187
For example, the following line is sufficient to indicate a REXX EXEC file:

Panel
/* REXX */

Anchor
1050407
1050407
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.

...

Anchor
1051217
1051217
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
ucmd -c "cref100 opt1,opt2" -cmd_type cmdref ...

Anchor
1050418
1050418
IBM i command references can define command types cmd and rexx.

...

Anchor
1054350
1054350
To use this cmdref, invoke UCMD Manager using:

Panel

...

ucmd -c "cmdref_cmd" -cmd_type cmdref -u xxxx -w zzzz -i as400

Anchor
1050424
1050424
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

<eof>

...

# -- File named cmdref_cmd in library UNVCMDREF --
# Use USBMJOB to execute the DSPLIB command.
#
-format cmd
-type cmd

<eof>

usbmjob cmd(dsplib qsysopr)


Anchor
1054331
1054331
The next command reference contains a series of four commands which are executed in sequence from top to bottom.

Anchor
1054367
1054367
Invoke these commands from system as4test using:

Panel

...

ucmd -c "cref_test" -cmd_type cmdref -u xxxx -w zzzz -i as4test

Anchor
1050453
1050453
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

<eof>

...

# -- 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

<eof>

DSPUSRPRF USRPRF(QUSER)
dspcurdir
usbmjob cmd(dsplib quser)
usbmjob cmd(dsplibl)

Anchor
1050481
1050481
REXX Command Reference Example

Anchor
1050482
1050482
The following command reference sends the message and the library catalog to standard output. The job logs are sent to standard error. Anchor10513411051341 To invoke this cmdref on system denver, use:

...

. The job logs are sent to standard error.

Anchor
1051341
1051341
To invoke this cmdref on system denver, use:

Panel
ucmd -c "rexx_test" -cmd_type cmdref -u xxxx -w zzzz -i denver

Anchor
1050484
1050484
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.

Anchor
1050485
1050485
Once again, the user, designated by the -u option, requires access to the object QWCRJBST. Without this access, usbmjob will fail.


Panel
# -- File named rexx_test in library UCVCMDREF --
# Use USBMJOB to execute the DSPLIB command.
#
-format script
-type rexx

<eof>

say "Submitting job to display library qsysopr"
'usbmjob cmd(dsplib qsysopr)'