AS400 Mid Range/AS400 (CMD Program)

Advertisement


Question
Hello,
I have created a simple program in CL to add few libraries to library list. I run that program from command line as "CALL library/program_name". Now, I want to create a shortcut command to run this program. For example shortcut command is ABC and program needs to be called is "CALL library/program_name". So when I enter ABC from command line this "CALL library/program_name" has to be called.
How should I do this. Please help.
Thank you
Pad


Answer
I am assuming that there are no parameters to be passed to your CL program.

1. Create a QCMDSRC source file to hold your command-source member:

   CRTSRCPF library/QCMDSRC

2. Use the EDTSRC command to open a command-source member in your QCMDSRC file (to keep things simple, use the same name as your CL program).

3. Enter a CMD line to serve as a header for your command:

             CMD        PROMPT('My command')

4. End SEU and save your command-source member.

5. Create the command:

  CRTCMD CMD(library/command name) PGM(library/CL program name)


If your CL program requires parameters, then you need to add one PARM line for each parameter after the CMD line in your command-source member.

- Laird

AS400 Mid Range

All Answers


Answers by Expert:


Ask Experts

Volunteer


Concise Systems/Laird Scranton

Expertise

General AS/400, RPG/400, SDA and CL programming questions. AS/400 performance tuning.

Experience


Past/Present clients
CB Sportswear
Coca-Cola of New York
Encore Paper Company
Golub Corporation
HBO Home Video
Imperial Pools
Kaiser Permanente of NE New York
Mallinckrodt Medical
Marigold Foods
Manpower & Associates
National Datacomputers
New York State Easter Seals Society
New York State Food Merchants Association
Pepsi-Cola Allied Bottlers
Petricca Construction
Taconic Telephone Corporation
TOMRA Recycling
Unistress Corporation

©2012 About.com, a part of The New York Times Company. All rights reserved.