If special authority is inherited from a group profile, will this still
work?
Regards,
Jim Hawkins
Programmer Analyst
Interkal LLC
Kalamazoo, MI
subject: Re: Remove special authority
Correction one:
I forgot the first line SELECT when I did a copy/paste. Add this <snip>
SELECT AUTHORIZATION_NAME, SPECIAL_AUTHORITIES, </snip> before the second
REPLACE(SPECIAL_AUTHORITIES, '*IOSYSCFG', ''),
Tried to find a simple example of a loop using IBM's QSYS2.QCMDEXC but I ran
out of time due to other priorities.
There is one advantage of using IBM's over the UDF. You have to make sure
you scroll all the way to the end when using the UDF otherwise the command
may not execute on every row. Providing you have that many people with
*IOSYSCFG.
Rob Berendt
--
IBM Certified System Administrator - IBM i 6.1 Group Dekko Dept 1600 Mail
to: 2505 Dekko Drive
Garrett, IN 46738
Ship to: Dock 108
6928N 400E
Kendallville, IN 46755
http://www.dekko.com
From: "Rob Berendt" <rob@xxxxxxxxx>
To: "Midrange Systems Technical Discussion" <midrange-l@xxxxxxxxxxxx>
Date: 09/24/2018 07:42 AM
Subject: Re: Remove special authority
Sent by: "MIDRANGE-L" <midrange-l-bounces@xxxxxxxxxxxx>
So what you're looking for is something like this:
SELECT AUTHORIZATION_NAME, SPECIAL_AUTHORITIES,
REPLACE(SPECIAL_AUTHORITIES, '*IOSYSCFG', ''),
'CHGUSRPRF USRPRF(' CONCAT AUTHORIZATION_NAME CONCAT
') SPCAUT(' CONCAT REPLACE(SPECIAL_AUTHORITIES, '*IOSYSCFG', '')
CONCAT ')' as COMMAND,
STATUS, NO_PASSWORD_INDICATOR, PREVIOUS_SIGNON, TEXT_DESCRIPTION
FROM QSYS2.USER_INFO
WHERE SPECIAL_AUTHORITIES LIKE '%*IOSYSCFG%'
ORDER BY AUTHORIZATION_NAME;
But you want it to actually execute the command COMMAND.
At Dekko we created our own QCMDEXC UDF for just such things. So the
above would become:
REPLACE(SPECIAL_AUTHORITIES, '*IOSYSCFG', ''),
'CHGUSRPRF USRPRF(' CONCAT AUTHORIZATION_NAME CONCAT
') SPCAUT(' CONCAT REPLACE(SPECIAL_AUTHORITIES, '*IOSYSCFG', '')
CONCAT ')' as COMMAND,
QCMDEXC('CHGUSRPRF USRPRF(' CONCAT AUTHORIZATION_NAME CONCAT
') SPCAUT(' CONCAT REPLACE(SPECIAL_AUTHORITIES, '*IOSYSCFG', '')
CONCAT ')')
STATUS, NO_PASSWORD_INDICATOR, PREVIOUS_SIGNON, TEXT_DESCRIPTION
FROM QSYS2.USER_INFO
WHERE SPECIAL_AUTHORITIES LIKE '%*IOSYSCFG%'
ORDER BY AUTHORIZATION_NAME;
But if you want to stick with IBM you can write a stored procedure program
to do it.
See
http://ibm.biz/DB2foriServices
Rob Berendt
As an Amazon Associate we earn from qualifying purchases.