Wednesday, 2 August 2017

Progress bar in AS400 (version 2)

This is another version of progress which most people like (previous version is here).


Source of display file
A                                      DSPSIZ(24 80 *DS3)                          
A          R DSPRCD                                                                
A                                      WINDOW(22 2 1 70 *NOMSGLIN)                  
A                                      OVERLAY                                      
A                                      WDWBORDER((*DSPATR HI))                      
A            PGRBAR        60   O  1 10                                            
A          R DUMMY                                                                  
A                                      ASSUME                                      
A                                      OVERLAY                                      
A                                 23  4'Job completed  Successfully'                
A                                      COLOR(RED)                                                                 


Note : Please make sure that while compiling display file Defer Write parameter should be *NO


Source of RPGLE

Hoption(*nodebugio:*srcstmt)                                            
 *                                                                      
FDUTIL002  cf   e             workstn                                    
 *                                                                      
D cmdstring       s            512                                      
D cmdlen          s             15p 5                                    
D i               s              2p 0                                    
D blue            c                   X'3B'                              
D normal          c                   X'20'                              
D char60          s             60a   inz(' ')                          
D arrow           c                   '>->'                              
 *                                                                      
Dqcmdexc          pr                  extpgm('QCMDEXC')                  
D cmd                         3000a   const options(*varsize)            
D cmdlen                        15p 5 const                              
D                                3a   const options(*nopass)            
 /free                                                                  
   cmdstring = 'DLYJOB DLY(1)';                                          
   cmdlen = %len(%trim(cmdstring));                                      
   for i = 1 to 60 by 10;                                          
     pgrbar = blue + %subst(char60:1:i) + arrow + normal;          
     write  dsprcd;                                                
     qcmdexc(cmdstring:cmdlen);                                    
   endfor;                                                          
   *inlr = *on;                                                      

Progress bar in AS400 (version 2)

This is another version of progress which most people like (previous version is here ). Source of display file A                     ...