Q
Manage Learn to apply best practices and optimize your operations.

Setting the*CMD parameter

I want to set the*CMD parameter in the CHGUSRAUD command for the users who have user class in *SECOFR.

CHGUSRAUD USRPRF (xxxxxxx) OBJAUD(*ALL) AUDLVL(*CMD)

How can I write the CL?

I want to set the*CMD parameter in the CHGUSRAUD command for the users who have user class in *SECOFR.

CHGUSRAUD USRPRF (xxxxxxx) OBJAUD(*ALL) AUDLVL(*CMD)

How can I write the CL?
Here is a sample -- obviously you will want to make sure it works for your specific environment -- I make no guarantees that this code sample will work for you.

First, run the following command:
DSPUSRPRF *ALL OUTFILE(QTEMP/USERS)

Then, run a program that does something like the following:

 
PGM                                                                
             DCL        VAR(&SECOFR) TYPE(*CHAR) VALUE('*SECOFR')  
             DCLF       FILE(QTEMP/USERS)                          
 LOOP:       RCVF                                                  
             MONMSG     MSGID(CPF9999) EXEC(GOTO CMDLBL(END))      
                                                                   
             /* IF THE USER IS IN THE SECOFR USER CLASS         */ 
             IF (&UPUSCL *EQ SECOFR) THEN(DO)                      
                CHGUSRAUD  USRPRF(&UPUPRF) OBJAUD(*ALL) +          
                           AUDLVL(*CMD)                            
                MONMSG CPF0000                                     
             ENDDO                                                 
                                                                   
             /* PROCESS THE NEXT PROFILE                        */ 
             GOTO       CMDLBL(LOOP)                               
 
 END:     
          ENDPGM             

Dig Deeper on iSeries system and application security

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchDataCenter

Close