After my post about how to create your own commands I received messages from readers giving me examples of how they have created their own shortcut commands, to do the same as the standard IBM i command but shorter. In one example the command SP did the same as WRKSPLF .

I don't think many people know of proxy commands. These allow me to create shortcut commands of the regular IBM i commands without any programming. You can even make proxies of proxy commands, although I cannot think of a reason why I would ever think to do so.

In this example I am going to create a proxy command, SP , for the Work with Spooled Files command, WRKSPLF .

I type the following:

CRTPRXCMD

Then I press F4 to prompt the command.

Create Proxy Command (CRTPRXCMD) Type choices, press Enter. Command . . . . . . . . CMD SP Library . . . . . . . MYLIB Target command . . . . . TGTCMD WRKSPLF Library . . . . . . . *LIBL Text 'description' . . . TEXT *TGTCMD

In the command parameters I have entered the name I wish to call my proxy command, SP , and the library it will reside in, MYLIB .

As this is my shortcut for WRKSPLF then the target command is WRKSPLF . I leave the library as *LIBL as the WRKSPLF command is in the library QSYS , which should be in everyone's library list.

I leave the text parameter as *TGTCMD . This gives my proxy command the same description as the target command. There is no reason why I could not use something like: "Simon's WRKSPLF proxy" if I so choose.

There are additional parameters, you can see by pressing F10, but I have never found a use for them.

When I press the Enter key the proxy command is created.

Work with Objects Using PDM Library . . . . . MYLIB Opt Object Type Attribute Text ANOTHER *CMD Another command SP *CMD PRX Work with Spooled Files

My new proxy command can be identified as one by the object attribute of PRX , which non-proxy commands do not have.

Now whenever I need to do WRKSPLF I can just type SP and the same command is executed.

If I need to change my proxy command I use the Change Proxy Command command, CHGPRXCMD .

Create Proxy Command (CRTPRXCMD) Type choices, press Enter. Command . . . . . . . . CMD Library . . . . . . . Target command . . . . . TGTCMD *SAME Library . . . . . . . Text 'description' . . . TEXT *SAME

If I choose to delete my proxy command I would just use the Delete Command command, DLTCMD .

DLTCMD MYLIB/SP

I only use the proxy commands as shortcuts on the IBM i command line. I always create them in my own library, that way they are only mine. I need to be careful when creating them to make sure that there is not another command of the same name "higher" in the library list. I would not use them in programs, as no-one else would know what my proxy commands are.

To make it easier for myself to remember what my proxy commands are I use the same names I use for my PDM options.

I also have is a source member, that can be compiled into a CL program, which lists all of my proxy commands. This way I can create the proxy commands on another system, without having to copy the commands themselves to the other location.

PGM DCL VAR(&LIB) TYPE(*CHAR) LEN(10) VALUE('MYLIB') CRTPRXCMD CMD(&LIB/WM) TGTCMD(WRKMBRPDM) CRTPRXCMD CMD(&LIB/WO) TGTCMD(WRKOBJPDM) CRTPRXCMD CMD(&LIB/SP) TGTCMD(WRKSPLF)

You can learn more about this from the IBM website:

This article was written for IBM i 7.3, and should work for earlier releases too.