Code:
- H NOMAIN
- *11/22/19 gem pxxxxxxx was program PRDALLOC, now a module.....
- *---------------------------------------------------------------------
- /copy qrpglesrc,@knapproto
- P PRODALLOC2 B export
- * *ENTRY Interface for Main Procedure
- DCL-PI PRODALLOC2;
- selitm CHAR(15);
- onord PACKED(10:2);
- alloc PACKED(10:2);
- cusa PACKED(10:2);
- END-PI;
- *---------------------------------------------------------------------
- if selitm = *blanks ;
- *inLR = *on;
- Return;
- endif;
- exec sql
- select
- COALESCE ((SUM(hpoqty) + SUM(fsoqty)), 0),
- sum(fmaqty) as alloc,
- sum(eclqty) as cusa
- into :onord, :alloc, :cusa
- from
- (SELECT
- --big old select statement is here
- )) as temp
- where item = :selitm group by item ;
-
- if sqlcode <> 0 ;
- onord = 0;
- alloc = 0;
- cusa = 0;
- endif ;
- return ;
- P PRODALLOC2 E
-
-
-
-
-
-
|
|