|
Mike, >>How can I get a listing of all devices a single user profile is >>signed on to so I can send break messages to all the active >>devices? The only thing I can think of is doing a WRKUSRJOB >>with *ACTIVE as the status to a print file. Then copying the >>spool file to a PF and then reading the print file. Then do >>a SNDBRKMSG command to the device name. This seems cumbersome. >>I sure there has to be a better way? I wrote a command a while back to do exactly what you're looking to do. It uses the QEZSNDMG api. It takes care of finding all the workstations a user is signed on to and then sends the message. It's not very long, so I'll take the liberty of posting below: Command Processing Program SNDBMUSRR: H * Command input parameters Dcmd_msg s 512a Dcmd_date s 7a Dcmd_time s 6a Dcmd_jobq s 20a Dcmd_user s 10a * QEZSNDMG output parameters Dz_msgtype s 10a inz('*INFO ') Dz_dlvmode s 10a inz('*BREAK ') Dz_msgtext s 494a Dz_msglen s 8b 0 inz(494) Dz_user s 10a Dz_#users s 8b 0 inz(1) Dz_msgsent s 8b 0 Dz_fkeyused s 8b 0 Dz_errorcode ds 216 D z_ec_#1 8b 0 inz(216) D z_ec_#2 8b 0 inz(0) D z_ec_#3 7a D z_ec_#4 1a D z_ec_#5 200a Dz_showsamdsp s 1a inz('N') Dz_inqmsgq s 20a inz(' ') Dz_nametype s 4a inz('*USR') * * Program Status Data Structure to retrieve user ID Dpsds sds Dpsds_userid 254 263a * C *entry plist C parm cmd_msg C parm cmd_user * C qez plist C parm z_msgtype C parm z_dlvmode C parm z_msgtext C parm z_msglen C parm z_user C parm z_#users C parm z_msgsent C parm z_fkeyused C parm z_errorcode C parm z_showsamdsp C parm z_inqmsgq C parm z_nametype * C movel(p) cmd_msg z_msgtext C if cmd_user = '*' C movel(p) psds_userid z_user C else C movel cmd_user z_user C endif * C call 'QEZSNDMG' qez * C eval *inLR = *on END OF Command Processing Program SNDBMUSRR Command SNDBMUSR: CMD PROMPT('Send Break Message to User') PARM KWD(MSG) TYPE(*CHAR) LEN(512) PROMPT('Message') PARM KWD(USER) TYPE(*SNAME) DFT(*) SPCVAL((*)) + PROMPT('User') END OF Command SNDBMUSR +--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to MIDRANGE-L@midrange.com. | To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com. | To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.