hi Bruce,
Trust me, I spared no mercy in my feedback to IBM on the example. Can you
believe this is on the technical support site???
I hope you mean "showed no mercy." :)
Since apparently nobody can come up with a good example of this API, I
threw one together. I probably made it more complicated than I needed
to... but it should (at least) be coded properly.
H DFTACTGRP(*NO) ACTGRP('KLEMENT') OPTION(*SRCSTMT)
D QSYRUSRI PR ExtPgm('QSYRUSRI')
D RcvVar 65535a options(*varsize)
D RcvVarLen 10i 0 const
D Format 8a const
D UsrPrf 10a const
D ErrorCode 32783a options(*varsize)
D QUILNGTX PR ExtPgm('QUILNGTX')
D text 65535a const options(*varsize)
D length 10i 0 const
D msgid 7a const
D qualmsgf 20a const
D errorCode 32783a options(*varsize)
D QMHRSNEM PR ExtPgm('QMHRSNEM')
D MsgKey 4A const
D ErrorCode 8000A options(*varsize)
D ToEntry likeds(RSNM0100)
D options(*nopass)
D ToEntLen 10i 0 const options(*nopass)
D ToEntFmt 8a const options(*nopass)
D FromAddr * const options(*nopass)
D FromCount 10i 0 const options(*nopass)
D RSNM0100 ds qualified
D counter 10i 0 inz(1)
D module 10a inz('*NONE')
D pgm 10a inz('*NONE')
D entrylen 10i 0 inz(7)
D entry 10a inz('*PGMBDY')
D ErrorNull ds qualified
D BytesProv 10i 0 inz(0)
D BytesAvail 10i 0 inz(0)
D USRI0100 ds qualified
D DaysTil 10i 0 overlay(USRI0100:69)
D msg s 200a varying
/free
monitor;
QSYRUSRI( USRI0100
: %size(USRI0100)
: 'USRI0100'
: '*CURRENT'
: ErrorNull );
on-error;
QMHRSNEM( *blanks
: ErrorNull
: RSNM0100
: %len(RSNM0100)
: 'RSNM0100'
: *null
: 0 );
endmon;
select;
when USRI0100.DaysTil = -1;
msg = 'Your password won''t expire +
in the next 7 days.';
when USRI0100.DaysTil = 0;
msg = 'Your password has expired.';
other;
msg = 'Your password will expire in '
+ %char(USRI0100.DaysTil)
+ ' days.';
endsl;
QUILNGTX( msg
: %len(msg)
: ' '
: ' '
: ErrorNull );
*inlr = *on;
/end-free
As an Amazon Associate we earn from qualifying purchases.