Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling a CL Program (or not)!

Status
Not open for further replies.

brent01

Technical User
Jul 11, 2001
32
0
0
GB
I have created a basic CL program MSGBRKS (all of 3 lines!)

I can run the program in the usual way -

CALL OPERATIONS/MSGBRKS , which works fine.

I have made sure the the OPERATIONS library is in my library list. So I can just type in CALL MSGBRKS to run the program

Is there any way of just typing in MSGRBKS to run the CL program without typing in CALL? I am sure it can be done, as there are other CL programs on another iseries that you can run without using CALL.

I have made sure the the OPERATIONS library is in my library list. So I can just type in CALL MSGBRKS

Any help would be most welcome.
 
The only way I know to call a CL program without the CALL is to create a command that calls the CL program and then call the command, which you can do by just typing the name.

Hope this helps.

--------------------------------
Rome did not create a great empire by having meetings, they did it by killing all those who opposed them.
 
Thanks gpzcrasher! Err.. any idea how I can create a command please?

Thanks
 
This is what I'd do assuming that no parameters are passed to your CL program ....

On a command line enter STRSEU and press F4

source file - usually QCMDSRC
library - your library (OPERATIONS)
source member - the name of the command (MSGBRKS)
source type - CMD
option - leave *BLANK
text description - a description of the command

Press enter

On the first line of the source type CMD and press F4

Prompt text or message ID - enter text that will appear at the top of the screen (Message Breaks) then press enter, F3 and enter

On the command line enter CRTCMD and press F4

Command - name of the command (MSGBRKS)
Libary - name of the library to place command (OPERATIONS)
Program to process command - the name of the program the cmd will call (MSGBRKS)
Library - the library the program is in (OPERATIONS)
Source file, library and member are the same as the ones you used when creating the source member above

Press enter twice

The command will now compile and if succesful you can now run your command by typing MSGBRKS on the command line, assuming your libary list is setup ok or OPERATIONS/MSGBRKS if not, and pressing enter

Hope this helps


--------------------------------
Rome did not create a great empire by having meetings, they did it by killing all those who opposed them.
 
Also, to avoid library list issues with the commands in the program, you could add the line "addlible operations" to the top of your cl and "rmvlible operations" at the bottom. I'm not sure if you're using system commands or fully qualifying other commands/programs. In that case, it's not necessary.

Mark

There are 10 types of people in this world, those who understand binary and those who don't.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top