midrange.com code scratchpad
Name:
show new bound module.
Scriptlanguage:
Plain Text
Tabwidth:
4
Date:
08/25/2021 07:14:40 pm
IP:
Logged
Description:
sub-routine, that became a module
Code:
  1. H NOMAIN                                                                   
  2.  *11/22/19  gem  pxxxxxxx  was program PRDALLOC, now a module.....         
  3.  *---------------------------------------------------------------------    
  4.  /copy qrpglesrc,@knapproto                                                
  5. P PRODALLOC2      B                   export                               
  6.  * *ENTRY Interface for Main Procedure                                     
  7.   DCL-PI PRODALLOC2;                                                       
  8.     selitm CHAR(15);                                                       
  9.     onord PACKED(10:2);                                                    
  10.     alloc PACKED(10:2);                                                    
  11.     cusa PACKED(10:2);                                                     
  12.   END-PI;                                                                  
  13.  *---------------------------------------------------------------------    
  14.    if  selitm = *blanks ;                                                  
  15.     *inLR = *on;                                                           
  16.     Return;                                                                
  17.    endif;                                                                  
  18.   exec sql                                                                 
  19.   select                                                                   
  20.    COALESCE ((SUM(hpoqty) + SUM(fsoqty)), 0),                              
  21.   sum(fmaqty) as alloc,                                                    
  22.   sum(eclqty) as cusa                                                      
  23.     into  :onord, :alloc, :cusa                                            
  24.       from                                                                 
  25.     (SELECT   
  26.          --big old select statement is here
  27.               )) as temp                                   
  28.       where item = :selitm group by item  ;                                
  29.                                                                            
  30.     if sqlcode <> 0 ;                                                      
  31.       onord = 0;                                                           
  32.       alloc = 0;                                                           
  33.       cusa = 0;                                                            
  34.     endif ;                                                                
  35.     return ;                                                               
  36. P PRODALLOC2      E                                                        
  37.  
  38.                                                                            
  39.                                                                            
  40.                                                                            
  41.                                                                            
  42.                                                                            
© 2004-2019 by midrange.com generated in 0.007s valid xhtml & css