TexAS400 Tutorial


TUTR011NC in QRPGLESRC in USER000



FCUST      UF   E           K DISK                                  
FTUTD010   CF   E             WORKSTN                               
 *----------------------------------------------------------------  
D ERR1            C                   CONST('You must enter A, C,-  
D                                      or D')                       
D ERR2            C                   CONST('Customer # is not fo-  
D                                     und')                         
D ERR3            C                   CONST('Name cannot be blank') 
D ERR4            C                   CONST('Addr cannot be blank') 
D ERR5            C                   CONST('City cannot be blank') 
D ERR6            C                   CONST('State cannot be blan-  
D                                     k')                           
D ERR7            C                   CONST('Zip is invalid')       
 *----------------------------------------------------------------  
C                   DoW       *in03 = *off                          
C                                                                   
C                   ExFmt     SCRN1                                  
C                                                                    
C                   If        *in03 = *off                           
C                   ExSr      Main                                   
C                   EndIf                                            
C                                                                    
C                   EndDo                                            
C                                                                    
C                   Eval      *inlr = *on                            
C                   Return                                           
C*----------------------------------------------------------------   
C     Main          BegSr                                            
C                                                                    
C     DSPCST        Chain     CUST                               95  
C                                                                    
C                   Eval      DSPMSG = *blanks                       
C                   Eval      *in90  = *off                          
C                                                         
C                   Select                                
C                                                         
C                   When      DSPACT = 'C'                
C                   If        *in95  = *on                
C                   Eval      DSPMSG = ERR2               
C                   Eval      *in90  = *on                
C                   Else                                  
C                   ExSr      ChangeRecord                
C                   EndIf                                 
C                                                         
C                   Other                                 
C                   Eval      DSPMSG  = ERR1              
C                   Eval      *in90   = *on               
C                   EndSl                                 
C                                                         
C                   EndSr                                 
C*---------------------------------------------------------------- 
C     ChangeRecord  BegSr                                                
C                                                                  
C* This starts a DO loop that will continue to loop                
C* Until DSPMSG is not blank OR *IN12 is *ON                       
C                   DoU       DSPMSG = *BLANKS   or                
C                             *in12  = *on                         
C                   ExFmt     SCRN2                                
C                                                                  
C                   If        *in12 =  *off                        
C                   ExSr      EditValues                           
C                   If        DSPMSG = *blanks                     
C                   Update    CSREC                                
C                   Leave                                          
C                   EndIf                                          
C                   EndIf                                          
C                                                                  
C                   EndDo                                          
C                                                                  
C                   EndSr                                          
C*---------------------------------------------------------------- 
C     EditValues    BegSr                                          
C* Make sure the values on the screen are OK                       
C                   If        CSNAME = *BLANKS                     
C                   Eval      DSPMSG = ERR3                        
C                   Eval      *in90  = *on                         
C                   EndIf                                          
C                                                                  
C                   If        CSADR1 = *BLANKS                     
C                   Eval      DSPMSG = ERR4                        
C                   Eval      *in90  = *on                         
C                   EndIf                             
C                                                     
C                   If        CSCTY  = *BLANKS        
C                   Eval      DSPMSG = ERR5           
C                   Eval      *in90  = *on            
C                   EndIf                             
C                                                     
C                   If        CSSTE  = *BLANKS        
C                   Eval      DSPMSG = ERR6           
C                   Eval      *in90  = *on            
C                   EndIf                             
C                                                     
C                   If        CSZIP  = ' '
C                   Eval      DSPMSG = ERR7           
C                   Eval      *in90  = *on            
C                   EndIf                             
C                                                     
C                   EndSr                 

 

 

Back to Table of Contents   |   Main Page