TechTalk: Using System Request to Execute a Comma

General
Typography
  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times

The AS/400 allows you to send a message to a message queue by using the System Request key with option 5 (Send a message). This can even be done while your workstation is input inhibited--unlike the Attention key program. By using the following program the "Send a message" option can be used to send a command which gets executed by the operating system.

The program EXCMD (1) executes a command which is sent to it from a message queue. After creating the program, enter the commands in 2 or add them to your initial program.

The program EXCMD (Figure 1) executes a command which is sent to it from a message queue. After creating the program, enter the commands in Figure 2 or add them to your initial program.

To enter a command at any time, press the System Request key and enter a "5" followed by a command in single quotes and the parameter "tomsgq(q)". For example:

5 'wrksbmjob *job' tomsgq(q)

If you want to prompt the command put a question mark in front of the command (i.e. ?wrksbmjob). You may also want to use this technique to 'call qcmd' to see and error messages which may be generated.

Robin Klima San Diego, California


TechTalk: Using System Request to Execute a Comma

Figure 1 The EXCMD program

 /* The following command must be executed before EXCMD can be + used: + ADDLIBLE LIB(QTEMP) + CRTMSGQ MSGQ(QTEMP/Q) + CHGMSGQ MSGQ(QTEMP/Q) DLVRY(*BREAK) PGM(EXCMD) */ EXCMD: + PGM PARM(&QUE &LIB &KEY) DCL VAR(&QUE) TYPE(*CHAR) LEN(10) DCL VAR(&LIB) TYPE(*CHAR) LEN(10) DCL VAR(&KEY) TYPE(*CHAR) LEN(4) DCL VAR(&CMD) TYPE(*CHAR) LEN(132) MONMSG MSGID(CPF0000) RCVMSG MSGQ(&LIB/&QUE) KEYVAR(&KEY) MSG(&CMD) CALL PGM(QCMDEXC) PARM(&CMD 132) ENDPGM 
TechTalk: Using System Request to Execute a Comma

Figure 2 Commands to set up Q message queue

 Figure 2 Commands To Set Up Q Message Queue ADDLIBLE LIB(QTEMP) CRTMSGQ MSGQ(QTEMP/Q) CHGMSGQ MSGQ(QTEMP/Q) DLVRY(*BREAK) PGM(EXCMD) 
BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$

Book Reviews

Resource Center

  •  

  • LANSA Business users want new applications now. Market and regulatory pressures require faster application updates and delivery into production. Your IBM i developers may be approaching retirement, and you see no sure way to fill their positions with experienced developers. In addition, you may be caught between maintaining your existing applications and the uncertainty of moving to something new.

  • The MC Resource Centers bring you the widest selection of white papers, trial software, and on-demand webcasts for you to choose from. >> Review the list of White Papers, Trial Software or On-Demand Webcast at the MC Press Resource Center. >> Add the items to yru Cart and complet he checkout process and submit

  • SB Profound WC 5536Join us for this hour-long webcast that will explore:

  • Fortra IT managers hoping to find new IBM i talent are discovering that the pool of experienced RPG programmers and operators or administrators with intimate knowledge of the operating system and the applications that run on it is small. This begs the question: How will you manage the platform that supports such a big part of your business? This guide offers strategies and software suggestions to help you plan IT staffing and resources and smooth the transition after your AS/400 talent retires. Read on to learn: