/*------------------------------------------------------------------*/
/* Programmers Group & Management Resource Copyright 1998 */
/* */
/* \\\\\\\ */
/* ( o o ) */
/*------------------------oOO----(_)----OOo-------------------------*/
/* */
/* System name . . . : Technical Support */
/* Program name . . . : RSTSYS */
/* Text . . . . . . . : CPP for Work with Active Users */
/* */
/* Author . . . . . . : Alexander Nubla */
/* Description . . . : The program is called to change the */
/* authorization setup & default parameters */
/* of commands in the system. */
/* */
/* ooooO Ooooo */
/* ( ) ( ) */
/*----------------------( )-------------( )---------------------*/
/* (_) (_) */
/* */
/* Modification Log: */
/* */
/* Tickt */
/* Date No. Programmer/Description */
/* ======== ===== ================================================ */
/* 05/06/98 Alex Nubla */
/* Created */
/* */
/*------------------------------------------------------------------*/
pgm
/*--------------------------------------------------------*/
/* declaration */
/*--------------------------------------------------------*/
dcl &autind *char 1
dcl &auts *char 30 '*ALLOBJ +
*SECADM +
*AUDIT '
dcl &autsno *char 4 X'00000003'
dcl &calllvl *char 4 X'00000000'
dcl &errcde *char 8 X'0000000000000000'
/*--------------------------------------------------------*/
/* parameter for QUSCRTUS & QUSLOBJ */
/*--------------------------------------------------------*/
dcl &usrspc *char 20
dcl &extatr *char 10 'ALL_OBJECT'
dcl &ussize *dec 8 5000
dcl &usinit *char 1 ' '
dcl &usauth *char 10 '*ALL'
dcl &ustext *char 50 'User Space for +
RSTSYS program'
dcl &fmtnme *char 8 'OBJL0100'
dcl &objnme *char 20
dcl &objtyp *char 10 '*ALL'
dcl &space *char 10
dcl &object *char 10
dcl &number *char 6
dcl &infosts *char 1
dcl &gends *char 140
/*--------------------------------------------------------*/
/* parameter for CVTB4DEC & CVTDECB4 */
/*--------------------------------------------------------*/
dcl &bin4 *char 4
dcl &loop *dec 10
dcl &elen *dec 10
dcl &elenb *char 4
dcl &strpos *dec 10
/*--------------------------------------------------------*/
/* parameter for object name retrieved */
/*--------------------------------------------------------*/
dcl &obj *char 10
dcl &objlib *char 10
dcl &objtype *char 7
dcl &objtxt *char 50
dcl &lobje *char 30
dcl &element *char 100
dcl &curnbr *dec 5 0
/*--------------------------------------------------------*/
/* error message variables */
/*--------------------------------------------------------*/
dcl &error *lgl /* std err */
dcl &msgid *char 7 /* std err */
dcl &msgkey *char 4 /* std err */
dcl &msgdta *char 100 /* std err */
dcl &msgf *char 10 /* std err */
dcl &msgflib *char 10 /* std err */
dcl &msgtyp *char 10 '*DIAG' /* std err */
dcl &msgtypctr *char 4 X'00000001' /* std err */
dcl &pgmmsgq *char 10 '*' /* std err */
dcl &stkctr *char 4 X'00000001' /* std err */
dcl &errbytes *char 4 X'00000000' /* std err */
monmsg msgid(cpf0000) exec(goto error)
/*--------------------------------------------------------*/
/* Check MY authority first */
/*--------------------------------------------------------*/
call QSYCUSRS parm(&autind +
*CURRENT +
&auts +
&autsno +
&calllvl +
&errcde)
if (&autind = 'Y') goto sysval
sndpgmmsg msgid(cpfb304) +
msgf(qcpfmsg) +
msgtype(*escape)
/*--------------------------------------------------------*/
/* Security system values: */
/*--------------------------------------------------------*/
sysval:
sndpgmmsg msgid(cpf9898) +
msgf(qcpfmsg) +
msgdta('Changing system values +
for KUBOTA standards') +
topgmq(*ext) +
msgtype(*status)
/* -------------------------------------------- */
/* Auditing Control & Level */
/* -------------------------------------------- */
chgsecaud QAUDCTL(*ALL) +
QAUDLVL(*DFTSET)
/* -------------------------------------------- */
/* Create Default Public Authority */
/* -------------------------------------------- */
chgsysval QCRTAUT *CHANGE
/* -------------------------------------------- */
/* Device I/O Error Action */
/* -------------------------------------------- */
chgsysval QDEVRCYACN *DSCMSG
/* -------------------------------------------- */
/* Time interval before disconnected jobs end */
/* -------------------------------------------- */
chgsysval QDSCJOBITV '60'
/* -------------------------------------------- */
/* Sign-on Display Information Control */
/* -------------------------------------------- */
chgsysval QDSPSGNINF '0'
/* -------------------------------------------- */
/* Inactive Job Time-out */
/* -------------------------------------------- */
chgsysval QINACTITV '60'
/* -------------------------------------------- */
/* Inactive Job Message Queue */
/* -------------------------------------------- */
chgsysval QINACTMSGQ *DSCJOB
/* -------------------------------------------- */
/* Limit Device Session */
/* -------------------------------------------- */
chgsysval QLMTDEVSSN '0'
/* -------------------------------------------- */
/* Limit Security Officer Device Access */
/* -------------------------------------------- */
chgsysval QLMTSECOFR '0'
/* -------------------------------------------- */
/* Action to take for Failed Signon Attempts */
/* -------------------------------------------- */
chgsysval QMAXSGNACN '2'
/* -------------------------------------------- */
/* Maximum Sign-on Attempts Allowed */
/* -------------------------------------------- */
chgsysval QMAXSIGN '3'
/* -------------------------------------------- */
/* Password Expiration Interval */
/* -------------------------------------------- */
chgsysval QPWDEXPITV '90'
/* -------------------------------------------- */
/* Limit Repeating Characters in Password */
/* -------------------------------------------- */
chgsysval QPWDLMTREP '0'
/* -------------------------------------------- */
/* Maximum Password Length */
/* -------------------------------------------- */
chgsysval QPWDMAXLEN 10
/* -------------------------------------------- */
/* Minimum Password Length */
/* -------------------------------------------- */
chgsysval QPWDMINLEN 6
/* -------------------------------------------- */
/* Limit Password Character Positions */
/* -------------------------------------------- */
chgsysval QPWDPOSDIF '0'
/* -------------------------------------------- */
/* Duplicate Password Control */
/* -------------------------------------------- */
chgsysval QPWDRQDDIF '6'
/* -------------------------------------------- */
/* Remote Sign-on Control */
/* -------------------------------------------- */
chgsysval QRMTSIGN *VERIFY
/* -------------------------------------------- */
/* Remote Service Attribute */
/* -------------------------------------------- */
chgsysval QRMTSRVATR '1'
/* -------------------------------------------- */
/* System Security Level */
/* -------------------------------------------- */
chgsysval QSECURITY '30'
/*--------------------------------------------------------*/
/* Restrict command usages: */
/*--------------------------------------------------------*/
sndpgmmsg msgid(cpf9898) +
msgf(qcpfmsg) +
msgdta('Revoking authorities +
of restricted commands to +
*PUBLIC users') +
topgmq(*ext) +
msgtype(*status)
grtobjaut obj(QSYS/ADDAJE) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/ADDCFGLE) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/ADDCMNE) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/ADDJOBQE) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/ADDPJE) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/ADDRTGE) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/ADDTCPHTE) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/ADDTCPIFC) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/ADDTCPPORT) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/ADDTCPRSI) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/ADDTCPRTE) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/ADDWSE) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/CHGAJE) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/CHGBPA) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/CHGCFGL) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/CHGCFGLE) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/CHGCMDDFT) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/CHGCMNE) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/CHGCTLAPPC) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/CHGDEVAPPC) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/CHGFTPA) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/CHGHTTPA) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/CHGJOBQE) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/CHGLPDA) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/CHGNETA) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/CHGOBJOWN) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/CHGPJE) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/CHGPOPA) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/CHGPGM) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/CHGRTGE) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/CHGRXCA) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/CHGSBSD) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/CHGSHRPOOL) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/CHGSMTPA) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/CHGTCPA) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/CHGTCPHTE) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/CHGTCPIFC) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/CHGTCPLPD) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/CHGTCPRTE) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/CHGTELNA) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/CHGTFTPA) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/CHGRTDA) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/CHGRXCA) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/CHGWSE) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/CHGWSGA) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/CLRLIB) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/CPYCFGL) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/CPYLIB) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/CRTCFGL) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/CRTCTLAPPC) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/CRTDEVAPPC) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/CRTLIB) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/CRTSAVF) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/CVTTCPCL) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/DLTLIB) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/EDTOBJAUT) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/ENDRMTSPT) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/ENDTCP) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/ENDTCPCNN) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/ENDTCPIFC) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/ENDTCPPTP) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/ENDTCPSVR) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/GRTOBJAUT) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/HLDDSTQ) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/MRGTCPHT) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/NETSTAT) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/PING) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/RLSDSTQ) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/RMVAJE) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/RMVCFGLE) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/RMVCMNE) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/RMVJOBQE) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/RMVPJE) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/RMVRTGE) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/RMVTCPHTE) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/RMVTCPIFC) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/RMVTCPPORT) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/RMVTCPRSI) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/RMVTCPRTE) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/RNMTCPHTE) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/RMVWSE) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/RSTLIB) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/RSTOBJ) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/SNDDSTQ) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/STRRMTSPT) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/STRTCP) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/STRTCPFTP) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/STRTCPIFC) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/STRTCPPTP) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/STRTCPSVR) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/STRTCPTELN) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/VFYTCPCNN) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/WRKBPTBL) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/WRKCFGL) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/WRKDSTQ) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/WRKNAMSMTP) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/WRKRTDCFG) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/WRKSYSSTS) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/WRKSYSACT) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/WRKSHRPOOL) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/WRKTCPSTS) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/WRKTCPPTP) +
objtype(*CMD) +
user(*PUBLIC) +
aut(*EXCLUDE)
/*----------------------------------------------*/
/* Restrict CFG* objects */
/*----------------------------------------------*/
chgvar &object 'CFG*'
chgvar %sst(&space 1 4) 'QOBJ'
rtvjoba nbr(&number)
chgvar %sst(&space 5 6) &number
dltusrspc qtemp/&space
monmsg cpf2105
chgvar %sst(&usrspc 1 10) &space
chgvar %sst(&usrspc 11 10) 'QTEMP'
call quscrtus parm(&usrspc +
&extatr +
&ussize +
&usinit +
&usauth +
&ustext)
chgvar %sst(&objnme 1 10) &object
chgvar %sst(&objnme 11 10) 'QSYS'
call quslobj parm(&usrspc +
&fmtnme +
&objnme +
&objtyp)
/*----------------------------------------------*/
/* Retrieve the general data structure from */
/* the user space. */
/*----------------------------------------------*/
call qusrtvus parm(&usrspc +
x'00000001' +
x'0000008C' +
&gends)
/*----------------------------------------------*/
/* Is the information incomplete? */
/*----------------------------------------------*/
if (&infosts = 'I') then(do)
sndpgmmsg msgid(cpf9898) +
msgf(qcpfmsg) +
msgdta('CFG* objects are not +
changed. Information is incomplete')
goto dltcfgspc
enddo
/*----------------------------------------------*/
/* Retrieve the number of entries returned. */
/*----------------------------------------------*/
chgvar &bin4 %sst(&gends 133 4)
chgvar &loop %bin(&bin4 1 4)
if (&loop = 0) goto dltcfgspc
/*----------------------------------------------*/
/* Retrieve the list entry length */
/*----------------------------------------------*/
chgvar &elenb %sst(&gends 137 4)
chgvar &elen %bin(&elenb 1 4)
/*----------------------------------------------*/
/* Get the starting offset */
/*----------------------------------------------*/
chgvar &bin4 ' '
chgvar &bin4 %sst(&gends 125 4)
chgvar &strpos %bin(&bin4 1 4)
chgvar &strpos (&strpos + 1) /* Offset = 1*/
/*----------------------------------------------*/
/* Loop through the number of entries until no */
/* no more entry is found. */
/*----------------------------------------------*/
loop1:
if (&loop = 0) goto dltcfgspc
/*----------------------------------------------*/
/* convert starting position to decimal */
/*----------------------------------------------*/
chgvar &bin4 ' '
chgvar %bin(&bin4) &strpos
call qusrtvus (&usrspc &bin4 &elenb &lobje)
chgvar &obj %sst(&lobje 1 10)
chgvar &objlib %sst(&lobje 11 10)
chgvar &objtype %sst(&lobje 21 7)
grtobjaut obj(&objlib/&obj) +
objtype(&objtype) +
user(*PUBLIC) +
aut(*EXCLUDE)
chgvar &strpos (&strpos + &elen)
chgvar &loop (&loop - 1)
goto loop1
dltcfgspc:
dltusrspc qtemp/&space
monmsg cpf0000
/*----------------------------------------------*/
/* Restrict CRTDEV* objects */
/*----------------------------------------------*/
chgvar &object 'CRTDEV*'
chgvar %sst(&space 1 4) 'QOBJ'
rtvjoba nbr(&number)
chgvar %sst(&space 5 6) &number
dltusrspc qtemp/&space
monmsg cpf2105
chgvar %sst(&usrspc 1 10) &space
chgvar %sst(&usrspc 11 10) 'QTEMP'
call quscrtus parm(&usrspc +
&extatr +
&ussize +
&usinit +
&usauth +
&ustext)
chgvar %sst(&objnme 1 10) &object
chgvar %sst(&objnme 11 10) 'QSYS'
call quslobj parm(&usrspc +
&fmtnme +
&objnme +
&objtyp)
/*----------------------------------------------*/
/* Retrieve the general data structure from */
/* the user space. */
/*----------------------------------------------*/
call qusrtvus parm(&usrspc +
x'00000001' +
x'0000008C' +
&gends)
/*----------------------------------------------*/
/* Is the information incomplete? */
/*----------------------------------------------*/
if (&infosts = 'I') then(do)
sndpgmmsg msgid(cpf9898) +
msgf(qcpfmsg) +
msgdta('CRTDEV* commands are not +
changed. Information is incomplete')
goto dltdevspc
enddo
/*----------------------------------------------*/
/* Retrieve the number of entries returned. */
/*----------------------------------------------*/
chgvar &bin4 %sst(&gends 133 4)
chgvar &loop %bin(&bin4 1 4)
if (&loop = 0) goto dltdevspc
/*----------------------------------------------*/
/* Retrieve the list entry length */
/*----------------------------------------------*/
chgvar &elenb %sst(&gends 137 4)
chgvar &elen %bin(&elenb 1 4)
/*----------------------------------------------*/
/* Get the starting offset */
/*----------------------------------------------*/
chgvar &bin4 ' '
chgvar &bin4 %sst(&gends 125 4)
chgvar &strpos %bin(&bin4 1 4)
chgvar &strpos (&strpos + 1) /* Offset = 1*/
/*----------------------------------------------*/
/* Loop through the number of entries until no */
/* no more entry is found. */
/*----------------------------------------------*/
loop2:
if (&loop = 0) goto dltdevspc
/*----------------------------------------------*/
/* convert starting position to decimal */
/*----------------------------------------------*/
chgvar &bin4 ' '
chgvar %bin(&bin4) &strpos
call qusrtvus (&usrspc &bin4 &elenb &lobje)
chgvar &obj %sst(&lobje 1 10)
chgvar &objlib %sst(&lobje 11 10)
chgvar &objtype %sst(&lobje 21 7)
grtobjaut obj(&objlib/&obj) +
objtype(&objtype) +
user(*PUBLIC) +
aut(*EXCLUDE)
chgvar &strpos (&strpos + &elen)
chgvar &loop (&loop - 1)
goto loop2
dltdevspc:
dltusrspc qtemp/&space
monmsg cpf0000
/*----------------------------------------------*/
/* Restrict CHGDEV* objects */
/*----------------------------------------------*/
chgvar &object 'CHGDEV*'
chgvar %sst(&space 1 4) 'QOBJ'
rtvjoba nbr(&number)
chgvar %sst(&space 5 6) &number
dltusrspc qtemp/&space
monmsg cpf2105
chgvar %sst(&usrspc 1 10) &space
chgvar %sst(&usrspc 11 10) 'QTEMP'
call quscrtus parm(&usrspc +
&extatr +
&ussize +
&usinit +
&usauth +
&ustext)
chgvar %sst(&objnme 1 10) &object
chgvar %sst(&objnme 11 10) 'QSYS'
call quslobj parm(&usrspc +
&fmtnme +
&objnme +
&objtyp)
/*----------------------------------------------*/
/* Retrieve the general data structure from */
/* the user space. */
/*----------------------------------------------*/
call qusrtvus parm(&usrspc +
x'00000001' +
x'0000008C' +
&gends)
/*----------------------------------------------*/
/* Is the information incomplete? */
/*----------------------------------------------*/
if (&infosts = 'I') then(do)
sndpgmmsg msgid(cpf9898) +
msgf(qcpfmsg) +
msgdta('CHGDEV* commands are not +
changed. Information is incomplete')
goto dltdevspc3
enddo
/*----------------------------------------------*/
/* Retrieve the number of entries returned. */
/*----------------------------------------------*/
chgvar &bin4 %sst(&gends 133 4)
chgvar &loop %bin(&bin4 1 4)
if (&loop = 0) goto dltdevspc3
/*----------------------------------------------*/
/* Retrieve the list entry length */
/*----------------------------------------------*/
chgvar &elenb %sst(&gends 137 4)
chgvar &elen %bin(&elenb 1 4)
/*----------------------------------------------*/
/* Get the starting offset */
/*----------------------------------------------*/
chgvar &bin4 ' '
chgvar &bin4 %sst(&gends 125 4)
chgvar &strpos %bin(&bin4 1 4)
chgvar &strpos (&strpos + 1) /* Offset = 1*/
/*----------------------------------------------*/
/* Loop through the number of entries until no */
/* no more entry is found. */
/*----------------------------------------------*/
loop3:
if (&loop = 0) goto dltdevspc3
/*----------------------------------------------*/
/* convert starting position to decimal */
/*----------------------------------------------*/
chgvar &bin4 ' '
chgvar %bin(&bin4) &strpos
call qusrtvus (&usrspc &bin4 &elenb &lobje)
chgvar &obj %sst(&lobje 1 10)
chgvar &objlib %sst(&lobje 11 10)
chgvar &objtype %sst(&lobje 21 7)
grtobjaut obj(&objlib/&obj) +
objtype(&objtype) +
user(*PUBLIC) +
aut(*EXCLUDE)
chgvar &strpos (&strpos + &elen)
chgvar &loop (&loop - 1)
goto loop3
dltdevspc3:
dltusrspc qtemp/&space
monmsg cpf0000
/*----------------------------------------------*/
/* Restrict CHGSYS* objects */
/*----------------------------------------------*/
chgvar &object 'CHGSYS*'
chgvar %sst(&space 1 4) 'QOBJ'
rtvjoba nbr(&number)
chgvar %sst(&space 5 6) &number
dltusrspc qtemp/&space
monmsg cpf2105
chgvar %sst(&usrspc 1 10) &space
chgvar %sst(&usrspc 11 10) 'QTEMP'
call quscrtus parm(&usrspc +
&extatr +
&ussize +
&usinit +
&usauth +
&ustext)
chgvar %sst(&objnme 1 10) &object
chgvar %sst(&objnme 11 10) 'QSYS'
call quslobj parm(&usrspc +
&fmtnme +
&objnme +
&objtyp)
/*----------------------------------------------*/
/* Retrieve the general data structure from */
/* the user space. */
/*----------------------------------------------*/
call qusrtvus parm(&usrspc +
x'00000001' +
x'0000008C' +
&gends)
/*----------------------------------------------*/
/* Is the information incomplete? */
/*----------------------------------------------*/
if (&infosts = 'I') then(do)
sndpgmmsg msgid(cpf9898) +
msgf(qcpfmsg) +
msgdta('CHGSYS* commands are not +
changed. Information is incomplete')
goto dltsysspc
enddo
/*----------------------------------------------*/
/* Retrieve the number of entries returned. */
/*----------------------------------------------*/
chgvar &bin4 %sst(&gends 133 4)
chgvar &loop %bin(&bin4 1 4)
if (&loop = 0) goto dltsysspc
/*----------------------------------------------*/
/* Retrieve the list entry length */
/*----------------------------------------------*/
chgvar &elenb %sst(&gends 137 4)
chgvar &elen %bin(&elenb 1 4)
/*----------------------------------------------*/
/* Get the starting offset */
/*----------------------------------------------*/
chgvar &bin4 ' '
chgvar &bin4 %sst(&gends 125 4)
chgvar &strpos %bin(&bin4 1 4)
chgvar &strpos (&strpos + 1) /* Offset = 1*/
/*----------------------------------------------*/
/* Loop through the number of entries until no */
/* no more entry is found. */
/*----------------------------------------------*/
loop4:
if (&loop = 0) goto dltsysspc
/*----------------------------------------------*/
/* convert starting position to decimal */
/*----------------------------------------------*/
chgvar &bin4 ' '
chgvar %bin(&bin4) &strpos
call qusrtvus (&usrspc &bin4 &elenb &lobje)
chgvar &obj %sst(&lobje 1 10)
chgvar &objlib %sst(&lobje 11 10)
chgvar &objtype %sst(&lobje 21 7)
grtobjaut obj(&objlib/&obj) +
objtype(&objtype) +
user(*PUBLIC) +
aut(*EXCLUDE)
chgvar &strpos (&strpos + &elen)
chgvar &loop (&loop - 1)
goto loop4
dltsysspc:
dltusrspc qtemp/&space
monmsg cpf0000
/*--------------------------------------------------------*/
/* Restrict menu usages */
/*--------------------------------------------------------*/
sndpgmmsg msgid(cpf9898) +
msgf(qcpfmsg) +
msgdta('Restricting secured +
menus to *PUBLIC users') +
topgmq(*ext) +
msgtype(*status)
grtobjaut obj(QSYS/CMN) +
objtype(*MENU) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/CMNCFG) +
objtype(*MENU) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/CMNSTS) +
objtype(*MENU) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/TCPADM) +
objtype(*MENU) +
user(*PUBLIC) +
aut(*EXCLUDE)
grtobjaut obj(QSYS/NETCFG) +
objtype(*MENU) +
user(*PUBLIC) +
aut(*EXCLUDE)
/*--------------------------------------------------------*/
/* Change command defaults */
/*--------------------------------------------------------*/
sndpgmmsg msgid(cpf9898) +
msgf(qcpfmsg) +
msgdta('Changing command +
defaults') +
topgmq(*ext) +
msgtype(*status)
sql:
chkobj obj(QSQL) +
objtype(*lib)
monmsg cpf9801 exec(goto RPG)
chgcmddft cmd(CRTSQLRPG) +
newdft('COMMIT(*NONE)')
monmsg cpf0000
chgcmddft cmd(CRTSQLRPGI) +
newdft('COMMIT(*NONE)')
monmsg cpf0000
chgcmd cmd(CRTSQLRPG) +
allow(*IMOD *BMOD *IREXX *BREXX *BPGM *EXEC *BATCH)
monmsg cpf0000
chgcmd cmd(CRTSQLRPGI) +
allow(*IMOD *BMOD *IREXX *BREXX *BPGM *EXEC *BATCH)
monmsg cpf0000
rpg:
chkobj obj(QRPG) +
objtype(*lib)
monmsg cpf9801 exec(goto RPGLE)
chgcmd cmd(CRTRPGPGM) +
allow(*IMOD *BMOD *IREXX *BREXX *BPGM *EXEC *BATCH)
rpgle:
chkobj obj(QRPGLE) +
objtype(*lib)
monmsg cpf9801 exec(goto C)
chgcmddft cmd(CRTBNDRPG) +
newdft('DBGVIEW(*SOURCE)')
monmsg cpf0000
chgcmddft cmd(CRTRPGMOD) +
newdft('DBGVIEW(*SOURCE)')
monmsg cpf0000
chgcmd cmd(CRTBNDRPG) +
allow(*IMOD *BMOD *IREXX *BREXX *BPGM *EXEC *BATCH)
monmsg cpf0000
chgcmd cmd(CRTRPGMOD) +
allow(*IMOD *BMOD *IREXX *BREXX *BPGM *EXEC *BATCH)
monmsg cpf0000
c:
chkobj obj(QCLE) +
objtype(*lib)
monmsg cpf9801 exec(goto CL)
chgcmddft cmd(CRTCMOD) +
newdft('DBGVIEW(*SOURCE)')
monmsg cpf0000
chgcmd cmd(CRTCMOD) +
allow(*IMOD *BMOD *IREXX *BREXX *BPGM *EXEC *BATCH)
monmsg cpf0000
cl:
chgcmddft cmd(CRTCLMOD) +
newdft('SRCFILE(QCLLESRC) DBGVIEW(*SOURCE)')
monmsg cpf0000
chgcmddft cmd(CRTBNDCL) +
newdft('SRCFILE(QCLLESRC) DBGVIEW(*SOURCE)')
monmsg cpf0000
chgcmd cmd(CRTCLMOD) +
allow(*IMOD *BMOD *IREXX *BREXX *BPGM *EXEC *BATCH)
monmsg cpf0000
chgcmd cmd(CRTBNDCL) +
allow(*IMOD *BMOD *IREXX *BREXX *BPGM *EXEC *BATCH)
monmsg cpf0000
pgm:
chgcmddft cmd(CRTBNDC) +
newdft('DBGVIEW(*SOURCE)')
monmsg cpf0000
chgcmddft cmd(CRTSRVPGM) +
newdft('EXPORT(*ALL) OPTION(*DUPPROC)')
monmsg cpf0000
chgcmd cmd(CRTPGM) +
allow(*IMOD *BMOD *IREXX *BREXX *BPGM *EXEC *BATCH)
monmsg cpf0000
chgcmd cmd(CRTBNDC) +
allow(*IMOD *BMOD *IREXX *BREXX *BPGM *EXEC *BATCH)
monmsg cpf0000
chgcmd cmd(CRTSRVPGM) +
allow(*IMOD *BMOD *IREXX *BREXX *BPGM *EXEC *BATCH)
monmsg cpf0000
sndpgmmsg msgid(cpf9898) +
msgf(qcpfmsg) +
msgdta('Reset of system completed')
lib:
chgcmddft cmd(CRTLIB) +
newdft('CRTAUT(*USE)')
monmsg cpf0000
usrprf:
chgcmddft cmd(CRTUSRPRF) +
newdft('PASSWORD(*NONE)')
monmsg cpf0000
dspf:
chgcmddft cmd(CRTDSP) +
newdft('RSTDSP(*YES)')
monmsg cpf0000
Goto End
/*--------------------------------------------------------*/
/* error routine: */
/*--------------------------------------------------------*/
error:
if &error (goto errordone)
else chgvar &error '1'
/*----------------------------------------------*/
/* move all *DIAG message to *PRV program queue*/
/*----------------------------------------------*/
call QMHMOVPM (&msgkey +
&msgtyp +
&msgtypctr +
&pgmmsgq +
&stkctr +
&errbytes)
/*----------------------------------------------*/
/* resend the last *ESCAPE message */
/*----------------------------------------------*/
errordone:
call QMHRSNEM (&msgkey +
&errbytes)
monmsg cpf0000 exec(do)
sndpgmmsg msgid(cpf3cf2) msgf(QCFPMSG) +
msgdta('QMHRSNEM') msgtype(*escape)
monmsg cpf0000
enddo
end: endpgm
               (
geocities.com/siliconvalley/pines)                   (
geocities.com/siliconvalley)