Sent via Deja.com http://www.deja.com/
Before you buy.
With the CRTCMD (Create Command) command, of course ;-)
Probably the easiest would be to look at Chapter 9. Defining Commands,
in the CL Programming book:
http://publib.boulder.ibm.com:80/cgi-bin/bookmgr/BOOKS/QB3AUO02/9.0
There are some examples at the end of the chapter, eg "Calling
Application Programs". Your program would become what is called the CPP
- Command Processing Program. The command definition can be simple if
you do not need to pass parameters to the CPP, or more complex if you
wish to pass parameters.
--
Karl Hanson
Haven't tried it recently, but many years ago used the trick of creating
a command with QCMD as the command processing program and hidden literal
text for the parm. It made it easy to create a shortcut for some
command that needed no dynamic parameters, just specification of some as
constants.
CMD PROMPT('Anzeigen Objektsource')
PARM KWD(OBJ) TYPE(QUAL1) MIN(1) PROMPT('Objekt')
PARM KWD(TYPE) TYPE(*CHAR) +
LEN(10) +
RSTD(*YES) +
DFT(*SEARCH) +
VALUES(*SEARCH +
*CMD +
*FILE +
*MODULE +
*PGM +
*TBL +
) +
PROMPT('Objektart')
PARM KWD(DSPMDL) TYPE(*CHAR) +
LEN(1) +
RSTD(*YES) +
DFT(*NO) +
SPCVAL((*YES 1) +
(*NO 0)) +
PMTCTL(*PMTRQS) +
PROMPT('ILE-Module auswählen')
QUAL1: QUAL TYPE(*NAME) LEN(10) MIN(1)
QUAL TYPE(*NAME) LEN(10) DFT(*LIBL) +
SPCVAL((*LIBL) (*CURLIB)) +
PROMPT('Bibliothek')
After you have coded the command you can create the command with the CRTCMD
command. At the CRTCMD command you must specify the command processing
program. The easiest command is a command without any parameter like this:
CMD PROMPT('Execute Program ABC')
You would create the command by executing the following command:
CRTCMD CRTCMD CMD(cmdLib/EXCPGMA)
PGM(pgmLib/ABC)
SRCFILE(srcLib/QCMDSRC)
SRCMBR(*CMD)
Sometimes it is a good idea to specify the PRODLIB parameter. The PRODLIB
will be inserted into the library list between the system part and the user
part of the library list during the command execution.
In order to avoid to type in that long string you talked about, you can
specify that string as a default value for the parameter. If you do not
want to see that parameter, when prompting the command, you can specify the
CONSTANT keyword.
You may refer to the "OS/400 CL Programming" manual if you need further
information.
Hope this helps.
Thomas Raddatz.
sk...@networld.com schrieb:
>
> How do you create custom commands that can be executed from the command
> line? For example we have to type in a long string on the command line
> to access one of our programs. Can I compact that into a short
> command? Thanks for your help.
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
--
*=====================================================*
e-mail Adresse:
Thomas....@Online-Club.de
Homepage:
http://www.online-club.de/~Thomas.Raddatz/
*=====================================================*
Regards
Anton Meyer
In article <8rvngq$hh4$1...@nnrp1.deja.com>,