Article

Code: RPG Program DIS_USR

Francis Lapeyre
 
..... *. 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                                                        
		

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
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
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: