Form VL_SAM132 : Tier Aware Subroutines

LANSA

Form VL_SAM132 : Tier Aware Subroutines
Name: VL_SAM132

Description: The following RDMLX form is used to demonstrate the execution of "subroutine" style functions VSAM131 and VSAM133. Refer to comments in the form for more information.
FUNCTION OPTIONS(*DIRECT);
BEGIN_COM HEIGHT(312) LEFT(299) TOP(225) VISUALSTYLE(#VS_NORM) WIDTH(382);
DEFINE_COM CLASS(#DEPTMENT.Visual) NAME(#DEPTMENT) CAPTION('Department Code (Input)') DISPLAYPOSITION(3) HEIGHT(19) LABELTYPE(Caption) LEFT(8) MARGINLEFT(125) PARENT(#GPBX_2) TABPOSITION(2) TOP(24) WIDTH(169);
DEFINE_COM CLASS(#TOTSALARY.Visual) NAME(#TOTSALARY) CAPTION('Total of Salaries (Output)') DISPLAYPOSITION(2) HEIGHT(19) LABELTYPE(Caption) LEFT(8) MARGINLEFT(125) PARENT(#GPBX_2) READONLY(True) TABPOSITION(3) TABSTOP(False) TOP(48) WIDTH(233);
DEFINE_COM CLASS(#PRIM_PHBN) NAME(#BTN_VSAM131) CAPTION('Execute') DISPLAYPOSITION(1) LEFT(264) PARENT(#GPBX_2) TABPOSITION(1) TOP(16);
DEFINE_COM CLASS(#PRIM_STBR) NAME(#STBR_1) DISPLAYPOSITION(1) HEIGHT(22) LEFT(0) MESSAGEPOSITION(1) PARENT(#COM_OWNER) TABPOSITION(3) TOP(263) WIDTH(374);
DEFINE_COM CLASS(#PRIM_GPBX) NAME(#GPBX_2) CAPTION('Execute the "subroutine" VSAM131') DISPLAYPOSITION(3) HEIGHT(81) LEFT(8) PARENT(#COM_OWNER) TABPOSITION(2) TABSTOP(False) TOP(16) WIDTH(356);
DEFINE_COM CLASS(#PRIM_GPBX) NAME(#GPBX_3) CAPTION('Execute the "subroutine" VSAM133') DISPLAYPOSITION(2) HEIGHT(145) LEFT(8) PARENT(#COM_OWNER) TABPOSITION(1) TABSTOP(False) TOP(112) WIDTH(356);
DEFINE_COM CLASS(#PRIM_PHBN) NAME(#BTN_VSAM133) CAPTION('Execute') DISPLAYPOSITION(1) LEFT(266) PARENT(#GPBX_3) TABPOSITION(4) TOP(16);
DEFINE_COM CLASS(#STD_CODES.Visual) NAME(#DEPCHAR1) CAPTION('Where Department Description starts with (input)') DISPLAYPOSITION(4) HEIGHT(19) LABELTYPE(Caption) LEFT(11) MARGINLEFT(230) PARENT(#GPBX_3) TABPOSITION(1) TOP(24) WIDTH(250);
DEFINE_COM CLASS(#STD_CODES.Visual) NAME(#SECCHAR1) CAPTION('Where Section Description starts with (input)') DISPLAYPOSITION(3) HEIGHT(19) LABELTYPE(Caption) LEFT(11) MARGINLEFT(230) PARENT(#GPBX_3) TABPOSITION(2) TOP(44) WIDTH(250);
DEFINE_COM CLASS(#STD_CODES.Visual) NAME(#SKLCHAR1) CAPTION('Where Skill Description starts with (input)') DISPLAYPOSITION(2) HEIGHT(19) LABELTYPE(Caption) LEFT(11) MARGINLEFT(230) PARENT(#GPBX_3) TABPOSITION(3) TOP(64) WIDTH(250);
DEFINE_COM CLASS(#STD_NUM.Visual) NAME(#SKILCOUNT) CAPTION('Skill Count (output)') DISPLAYPOSITION(5) HEIGHT(19) LABELTYPE(Caption) LEFT(11) MARGINLEFT(230) PARENT(#GPBX_3) READONLY(True) TABPOSITION(5) TABSTOP(False) TOP(110) WIDTH(289);
DEFINE_COM CLASS(#PRIM_LABL) NAME(#LABL_1) CAPTION('( Note: Blank in any of these values means select all ) ') DISPLAYPOSITION(6) HEIGHT(57) LEFT(266) PARENT(#GPBX_3) TABPOSITION(6) TABSTOP(False) TOP(48) WIDTH(79);
;
* ===============================================================;
*;
* Handle a click of the VSAM131 execute button by calling the RDML function;
* VSAM131 to do the calcualtion and return the result into #TOTSALARY.;
*;
* VSAM131 is an example of a classic "subroutine". You put in a ;
* department (#DEPTMENT) and get back the total value of the salaries ;
* of all the employees that work in the the department (#TOTSALARY). ;
*;
* What is special about VSAM131 (whose code you should review) is it's;
* ability to work in any environment (eg: L4Win, L4Web, 5250 Green screen);
* as a standard subroutine, and also to be able to optimize its performance;
* in a tiered environment such as this one. ;
* ;
* VSAM131 has an awareness of "tiers" named APPL and DATA. ;
* ;
* By indicating which tier it would like to use via the system variables;
* *APPL_TIER and *DATA_TIER it's logic and data access can be;
* directed onto the appropriate tier. ;
* ;
* Finally, the fact that VLSAM131 can optimize its performance in a tiered;
* environment is invisible to this form. The person coding this form would ;
* not even have to know about this.;
* ;
* ===============================================================;
;
EVTROUTINE HANDLING(#Btn_VSAM131.Click);
Message 'Calculating Total of salaries' Type(*Status);
Exchange #Deptment ;
Call Process(*Direct) Function(VSAM131) exit_used(*next) menu_used(*next);
ENDROUTINE;
;
* ===============================================================;
*;
* Handle a click of the VSAM133 execute button by calling the RDML function;
* VSAM133 to do the calcualtion and return the result into #SKILCOUNT;
* ;
* VSAM133 has exactly the same "smart" logic as VLSAM131, but the logic it;
* uses to calculate it's result accentuates the performance differences that are;
* seen between "thick" and "thin" client execution modes, especially where;
* the communication link between the different tiers is slower (eg: WAN, ;
* Internet dial up, etc). ;
* ;
* ===============================================================;
;
EVTROUTINE HANDLING(#Btn_VSAM133.Click);
Message 'Calculating Skill Count' Type(*Status);
Exchange (#DepChar1 #SecChar1 #SklChar1) ;
Call Process(*Direct) Function(VSAM133) exit_used(*next) menu_used(*next);
ENDROUTINE;
;
END_COM;