Awhile back, I was asked if it were possible to determine when the RUNQRY command had been canceled with F3 or F12. I had no answer, but Tom Liotta of PowerTech Group (www.400security.com) did, and he shared it with me. Tom uses the QUSRJOBI API to test for these keys. Pressing F3 or F12 places a character 1 in byte 103 or 104, respectively.
Following is Tom's code, which I have modified slightly. First, I shortened the lines that were too long for the purposes of this tip. Second, I added the return commands to the do groups. Third, I added the outtype(*PRINTER) parameter to the RUNQRY command. That's not necessary, but trapping a cancel request probably makes more sense when output is to be sent to a printer, since outtype(*DISPLAY) causes RUNQRY to be prompted over and over until it is canceled.
Tom had separate tests for F3 and F12. If you don't care which key the operator pressed, you might want to combine the two do groups into one. Tom adds, "This code can be used in many cases for functions that do not send messages when cancelled. I believe this is standard for UIM [User Interface Manager]-based functions." Thanks for sharing this useful technique with your fellow readers, Tom!
dcl &a_len *char 4 /* Bin Data/Entry length */ dcl &a_rcv *char 1000 /* Receiver Variable, the */ /* length is variable. It */ /* must be in &A_LEN. */
/* ---------------------------------------------------*/ /* RUNQRY was not canceled */ /* ---------------------------------------------------*/
Ted Holt is an IT consultant living in northeast Mississippi. He welcomes your comments at This email address is being protected from spambots. You need JavaScript enabled to view it..
Do you have a tip to share?
The useful techniques you discovered or created to help you do your job are exactly the techniques others are looking for! Share with your peers! Send your tips to This email address is being protected from spambots. You need JavaScript enabled to view it..
Ted Holt is IT manager of Manufacturing Systems Development for Day-Brite Capri Omega, a manufacturer of lighting fixtures in Tupelo, Mississippi. He has worked in the information processing industry since 1981 and is the author or co-author of seven books.
This book provides an amazingly comprehensive introduction to the concepts while at the same time delivering enough technical detail to make you productive very quickly.
Today, it's all about input and output. Getting data into the IBM i from non-traditional sources and then displaying it back out again in varied formats. But where can you go to learn all that you need to know about this critical skill?
Too valuable to be classified as merely excellent certification material, this book should also rightly take its place on DB2 DBA bookshelves as a solid day-to-day DB2 reference.
Whether you want to obtain an IBM certified DB2 professional certification or simply become well-rounded in the fundamental concepts of DB2 and general database theory, this is your book.
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
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:
LATEST COMMENTS
MC Press Online