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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

send a reply to a msg in qsysopr from cl

Status
Not open for further replies.

os400

MIS
Mar 20, 2003
129
US
Merry Christmas to All.

Is there a way to answer an inquiry message in qsysopr from with in a CL pgm? The story is this, we get about 10-12 screens of printer not available messages everyday. So far we have to reply to them one at a time. I'm trying to automate the process of replying to them. I'm looking at dumping qsysopr to a splf then to a dbf, reading the dbf and then somehow sending a reply back to qsysopr. Right now, I'm stopped at the send the reply back part.

I'm headed in the right direction? Any ideas are appreciated.

TIA

Mike Butler
Iseries Guy -> PC's gone, SUNs gone - WooHoo
"Never put off 'til tomorrow what you should have done yesterday
 
The problem is to get the key of a specific message to send reply to the message in qsysopr msgq.
IMHO the only way to get the key is to read messages from qsysopr msgq until you find the message or message id you want.

Code:
dcl &keyvar *char  4  
dcl &msgid  *char  7  
dcl &msg    *char 80 

loop: rcvmsg msgq( qsysopr ) +
             rmv( *no )keyvar( &keyvar )  +       
             msgid( &msgid ) msg( &msg ) 
if ( &msgid = ' ' ) return 
if ( &msgid = [i]'CPx....'[/i] ) +                                 
 sndrpy msgkey( &keyvar ) msgq( mymsgq ) rpy( [i]'whatever'[/i] ) rmv( *no ) 
goto loop
 
Are the responses to the printer messages ALWAYS the same (ie. do you ALWAYS want the "Load form", "Verify alignment", "Operator action", etc messages answered with the SAME response EVERY time?

If so, you could always add a reply entry (ADDRPYLE) to the message ID, so it will automatically answer the message for you.

But be advised, that on a message such as "Operator Action required" with a reply of "R", this could cause a lot of messages to go to the sysopr queue, if the printer itself does need attention.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top