Article

Built-in Commands Make Your Enterprise Scheduling Environment Even More Robust

Helpful scheduling commands for IBM i-centric batch process automation
IBM i
Posted:
November 20, 2019

 

When you’re looking for enhanced integration, try these commands that come with the Robot Schedule Enterprise extension to Robot Schedule. You’ll bring greater flexibility and creativity for coding your .bat files or scripts by allowing communication back to the IBM i server via triggering jobs, sending messages, passing values, and updating parameter values.

There are corresponding commands for both Windows and a UNIX/Linux agent. As with any commands, help features are available. These commands are located in the Robot Schedule Enterprise subdirectory located on the server.

Command #1: fireevent

Familiar with reactivity in Robot Schedule? This is the mechanism for setting up dependencies between jobs, whether IBM i batch or agent jobs.

One type of dependency available with Robot Schedule Enterprise is an “agent event” and one type of agent event that can be defined is a “manual event”.

The fireevent command triggers this manual agent event prerequisite for the Robot Schedule reactive job from your program, .bat file, or script, and can even pass a parameter value back. This information is stored in the agent event history as well.

For example: 

fireevent edidone "EDI processing complete."

Manual agent event reactivity

On the Robot Schedule job that reacts to the manual event EDIDONE, the value inside the quotes will be captured using a variable @@EDIDONE in the command panel of the reactive job. Use this variable to pass into another program, for example: 

CALL PGM(PAYLIB/PAY105 PARM(@@EDIDONE))

Command #2: sendmsg

The sendmsg command allows you to send a message from the agent server back an IBM i message queue. The sendmsg command can send a message back to the system or to the Robot products on the IBM i server from the agent.

You can communicate to these Robot products: Robot Alert, Robot Console, Robot Schedule, Robot Network, or back to a message queue.

For example, to send a message back to the system operator message queue use this command in your .bat file:

sendmsg -m SNDMSG -r QSYSOPR -t "This message is coming from my bat file."

To send a Robot Alert message, change the –m parameter to ALERT. To send to Robot Network, change the –m parameter to NETWORK, and so on. For a full list of options see the help for this command.

Command #3: getstatus

The getstatus command displays the agent connection status at the agent server and can be executed from a command line on the agent to determine if it is communicating to the IBM i host.

Robot Schedule Enterprise getstatus command

Command #4: getactivity

The getactivity command displays Robot Schedule Enterprise activity at the agent server and can also be executed from a command line on the agent to list Robot Schedule Enterprise initiated active jobs, file transfers, job monitors, file monitors, directory monitors, and manual events.

Robot Schedule Enterprise getactivity command

Command #5: setrcv

The setrcv command allows you to set the value of a Robot Schedule reserved command variable to a fixed value or the value of an environment variable. 

You can either specify a specific character value or, if the same variable exists in the environment variables, it will use that value. 

Do not use the @@ prefix when specifying the reserved command variable. If setting to a specific value, enclose the variable and value in quotes.

To set the @@MFGTOTAL variable to a value use this command:

setrcv "mfgtotal=10000"

Or to set the @@ACCTDAY variable to the environment variable of the same name use this command:

setrcv acctday

Command #6: getrcv

The getrcv command retrieves the value of a Robot Schedule reserved command variable and outputs it to Standard Output. In order to use the value of that Standard Output, redirect the Standard Output to a .bat file and then run the .bat file.

For example:

cd C:\Program Files\Help Systems\Robot Schedule Enterprise Agent
getrcv mfgacct > myenv.bat
myenv.bat
echo %mfgacct%

In the example above, the first command changes the directory so it can find the getrcv command. The second command gets the value of the reserved command variable @@MFGACCT, which is set up on the IBM i server that is used by the agent. 

It does NOT output the value of @@MFGACCT to myenv.bat. Rather, it outputs the actual command 'set mfgacct=tuesday' ('tuesday' is the value of the reserved command variable @@MFGACCT that was retrieved).

When the third command runs, myenv.bat runs the command that is in it, which is 'set mfgacct=xxx' and the variable is set so you can use it in the remaining commands, such as in the last command.

IBM i-Centric Enterprise Job Scheduling

It can sometimes feel like IBM i is an island technology—the Windows team and the IBM i team might not even work in the same building—but the platform has tremendous value and substantial benefits, especially where job scheduling is concerned.

HelpSystems has been in the automation business for 35+ years and we’ve had a lot of positive feedback from our enterprise scheduling customers. They like that they have a central scheduling console. That is to say a single place to go to schedule all their tasks and dependencies—and eliminate timer jobs. They also like that they have notifications and historical reporting when a job or task doesn’t complete as it should.

To learn more about IBM i-centric enterprise job scheduling at HelpSystems, you can always contact us or explore these resources on your own:

Time to Replace Legacy AS/400 Schedulers?

Your business has changed. But has batch processing kept pace? If not, we can help! Download this guide where we help you assess your processing methods and identify the signs that it’s time for a change.

Related Products

Related Solutions

Stay up to date on what matters.