Code: RPG Program DIS_USR

Code: RPG Program DIS_USR

 
..... *. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ...+... 8 
      *                                                                          
     FALLUSER IF  E                    DISK                           UC         
     FGOODUSERO   E                    DISK                      A    UC         
     E                    CMD     1   7 80               COMMANDS                
     I            DS                                                             
     I                                        1  10 UPUPRF                       
     I                                        1   1 FRSTLT                       
     I                                        1   2 FRST2                        
     I              '*DISABLED'           C         DISABL                       
     C           1         DO   3         X       10                             
     C                     MOVELCMD,X     COMAND 80 P                            
     C                     CALL 'QCMDEXC'                                        
     C                     PARM           COMAND                                 
     C                     PARM 80        LENGTH 155                             
     C                     ENDDO                                                 
     C                     OPEN ALLUSER                                          
     C                     OPEN GOODUSER                                         
     C           *INLR     DOUEQ*ON                                              
     C                     READ QSYDSUPB                 LR                     
     C           *INLR     IFEQ *ON                                             
     C                     LEAVE                                                
     C                     ENDIF                                                
     C           FRSTLT    IFEQ 'Q'                        IBM supplied?        
     C           FRST2     ANDNE'Q_'                                            
     C           UPUSCL    OREQ '*SYSOPR'                  System operator?     
     C           UPUSCL    OREQ '*SECOFR'                  Security officer?    
     C           UPUSCL    OREQ '*SECADM'                  Security admin?      
     C           UPUSCL    OREQ '*PGMR'                    Programmer?          
     C           UPSTAT    OREQ DISABL                     Already disabled?    
     C                     ITER                            Then, don't touch!   
     C                     ENDIF                                                
     C           CMD,4     CAT  UPUPRF:0  COMAND    P                           
     C           COMAND    CAT  CMD,5:0   COMAND                                
     C                     CALL 'QCMDEXC'                                       
     C                     PARM           COMAND                                
     C                     PARM 80        LENGTH                                
     C                     MOVELUPUPRF    USRUSR    P                           
     C                     WRITEUSR                                             
     C                     ENDDO                                                
     C                     CLOSEALLUSER                                         
     C                     CLOSEGOODUSER                                        
     C           6         DO   2         X                                     
     C                     MOVELCMD,X     COMAND                                
     C                     CALL 'QCMDEXC'                                       
     C                     PARM           COMAND                                
     C                     PARM 80        LENGTH                                
     C                     ENDDO                                                
**                                                                              
CLRPFM FILE(*LIBL/GOODUSER)                                                     
DSPUSRPRF USRPRF(*ALL) TYPE(*BASIC) OUTPUT(*OUTFILE) OUTFILE(QTEMP/ALLUSER)     
OVRDBF FILE(ALLUSER) TOFILE(QTEMP/ALLUSER)                                      
CHGUSRPRF USRPRF(                                                               
) STATUS(*DISABLED)                                                             
DLTOVR FILE(ALLUSER)                                                            
DLTF FILE(QTEMP/ALLUSER)                                                        

RPG Program ENA_USR:

..... *. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ...+... 8    
     FGOODUSERIF  E                    DISK                                         
     E                    CMD     1   2 80               COMMANDS                   
     C           *INLR     DOUEQ*ON                                                 
     C                     READ USR                      LR                         
     C           *INLR     IFEQ *ON                                                 
     C                     LEAVE                                                    
     C                     ENDIF                                                    
     C           CMD,1     CAT  USRUSR:0  COMAND    P                               
     C           COMAND    CAT  CMD,2:0   COMAND                                    
     C                     CALL 'QCMDEXC'                                           
     C                     PARM           COMAND 80                                 
     C                     PARM 80        LENGTH 155                                
     C                     ENDDO                                                    
**                                                                                  
CHGUSRPRF USRPRF(                                                                   
) STATUS(*ENABLED)                                                                  

DDS Source for file GOODUSER:

*************** Beginning of data **********************************************
     A*GOODUSER - GOOD USERS                                                    
     A*                                                                         
     A                                      UNIQUE                              
     A          R USR                                                           
     A                                      TEXT('GOOD USERS')                  
     A            USRUSR        10A         TEXT('USER NAME')                   
     A          K USRUSR                                                        
		

Dig Deeper on RPG iSeries programming

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

SearchEnterpriseLinux

SearchDataCenter

Close