Using Dynamic System i Queries in a Robot/SCHEDULE Job
This Help/FACTS shows you how to run System i queries from Robot/SCHEDULE by passing in dynamic parameters, such as the current date. It uses Query Management features with Robot/SCHEDULE Reserved Command Variables. There is a query called QUERY in library DAN, which creates a list of all OPEN calls older than a certain date. The example schedules the query in Robot/SCHEDULE weekly and lists all open calls greater than 4 weeks old.
- Create the query and make record selections using dependent values for the variable you want to dynamically change in Robot/SCHEDULE.
- Press Enter to display the screen shown below. Fill in as shown (DUMMY query does not need to exist in LIB DAN). Press Enter, then exit and save your query.
- Go into Robot/SCHEDULE and create a Command type job. Fill in the command STRQMQRY with the parameters shown below. For this example, a Reserved Command Variable has been created to calculate current date minus 28 days (@@DATEM28).
Note: Use a colon before the value to make it a dependent value.



When you run the Robot/SCHEDULE job, the Reserved Command Variable @@DATEM28 is replaced with the correct value and the query is given that value.




