home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
viscobv6.zip
/
vac22os2
/
ibmcobol
/
samples
/
elookup1
/
thedata.cbv
< prev
next >
Wrap
Text File
|
1997-07-25
|
22KB
|
622 lines
* Feature source code generation begins here...
* METHOD
IDENTIFICATION DIVISION.
METHOD-ID. "getADataBlk".
DATA DIVISION.
LOCAL-STORAGE SECTION.
LINKAGE SECTION.
01 ADataBlk.
COPY 'dataarea.cpy'.
01 rc PIC S9(9) USAGE COMP-5.
PROCEDURE DIVISION
RETURNING ADataBlk.
MOVE iADataBlk TO ADataBlk.
GOBACK.
END METHOD "getADataBlk".
* METHOD
IDENTIFICATION DIVISION.
METHOD-ID. "setADataBlk".
DATA DIVISION.
LOCAL-STORAGE SECTION.
01 aTheData USAGE OBJECT REFERENCE TheData.
01 event USAGE OBJECT REFERENCE CNotificationEvent.
01 aDataBlkId USAGE POINTER.
LINKAGE SECTION.
01 ADataBlk.
COPY 'dataarea.cpy'.
01 rc PIC S9(9) USAGE COMP-5.
PROCEDURE DIVISION USING ADataBlk.
MOVE ADataBlk TO iADataBlk.
INVOKE CNotificationEvent "somNew" returning event.
SET aTheData TO SELF.
INVOKE SELF "getADataBlkId"
RETURNING aDataBlkId.
INVOKE event "initializeNotificationEvent" USING
by value aDataBlkId by value aTheData.
INVOKE SELF "notifyObservers" using by value event.
INVOKE event "somFree".
GOBACK.
END METHOD "setADataBlk".
* METHOD
IDENTIFICATION DIVISION.
METHOD-ID. "getNumResults".
DATA DIVISION.
LOCAL-STORAGE SECTION.
LINKAGE SECTION.
01 NumResults.
03 NumResults-Length PIC 9(9) COMP-5.
03 NumResults-String.
05 NumResults-Chars PIC X
OCCURS 1 TO 255 TIMES
DEPENDING ON NumResults-Length.
01 rc PIC S9(9) USAGE COMP-5.
PROCEDURE DIVISION
RETURNING NumResults.
* Begin hand coded extensions
* ---------------------------------------------
Move 2 to NumResults-Length.
If Results-Knt > 50 or Results-Knt < 0
Move "00" to NumResults-string
Else
Move Results-Knt to NumResults-string
End-If.
* ---------------------------------------------
* End hand coded extensions
GOBACK.
END METHOD "getNumResults".
* METHOD
IDENTIFICATION DIVISION.
METHOD-ID. "getEmpname".
DATA DIVISION.
LOCAL-STORAGE SECTION.
LINKAGE SECTION.
01 Empname.
03 Empname-Length PIC 9(9) COMP-5.
03 Empname-String.
05 Empname-Chars PIC X
OCCURS 1 TO 255 TIMES
DEPENDING ON Empname-Length.
01 rc PIC S9(9) USAGE COMP-5.
PROCEDURE DIVISION
RETURNING Empname.
MOVE iEmpname-Length TO Empname-length.
MOVE iEmpname-String TO Empname-string.
GOBACK.
END METHOD "getEmpname".
* METHOD
IDENTIFICATION DIVISION.
METHOD-ID. "setEmpname".
DATA DIVISION.
LOCAL-STORAGE SECTION.
01 aTheData USAGE OBJECT REFERENCE TheData.
01 event USAGE OBJECT REFERENCE CNotificationEvent.
01 empnameId USAGE POINTER.
LINKAGE SECTION.
01 Empname.
03 Empname-Length PIC 9(9) COMP-5.
03 Empname-String.
05 Empname-Chars PIC X
OCCURS 1 TO 255 TIMES
DEPENDING ON Empname-Length.
01 rc PIC S9(9) USAGE COMP-5.
PROCEDURE DIVISION USING Empname.
MOVE Empname-Length TO iEmpname-length.
MOVE Empname-String TO iEmpname-string.
INVOKE CNotificationEvent "somNew" returning event.
SET aTheData TO SELF.
INVOKE SELF "getEmpnameId"
RETURNING empnameId.
INVOKE event "initializeNotificationEvent" USING
by value empnameId by value aTheData.
INVOKE SELF "notifyObservers" using by value event.
INVOKE event "somFree".
GOBACK.
END METHOD "setEmpname".
* METHOD
IDENTIFICATION DIVISION.
METHOD-ID. "getEmpdep".
DATA DIVISION.
LOCAL-STORAGE SECTION.
LINKAGE SECTION.
01 Empdep.
03 Empdep-Length PIC 9(9) COMP-5.
03 Empdep-String.
05 Empdep-Chars PIC X
OCCURS 1 TO 255 TIMES
DEPENDING ON Empdep-Length.
01 rc PIC S9(9) USAGE COMP-5.
PROCEDURE DIVISION
RETURNING Empdep.
MOVE iEmpdep-Length TO Empdep-length.
MOVE iEmpdep-String TO Empdep-string.
GOBACK.
END METHOD "getEmpdep".
* METHOD
IDENTIFICATION DIVISION.
METHOD-ID. "setEmpdep".
DATA DIVISION.
LOCAL-STORAGE SECTION.
01 aTheData USAGE OBJECT REFERENCE TheData.
01 event USAGE OBJECT REFERENCE CNotificationEvent.
01 empdepId USAGE POINTER.
LINKAGE SECTION.
01 Empdep.
03 Empdep-Length PIC 9(9) COMP-5.
03 Empdep-String.
05 Empdep-Chars PIC X
OCCURS 1 TO 255 TIMES
DEPENDING ON Empdep-Length.
01 rc PIC S9(9) USAGE COMP-5.
PROCEDURE DIVISION USING Empdep.
MOVE Empdep-Length TO iEmpdep-length.
MOVE Empdep-String TO iEmpdep-string.
INVOKE CNotificationEvent "somNew" returning event.
SET aTheData TO SELF.
INVOKE SELF "getEmpdepId"
RETURNING empdepId.
INVOKE event "initializeNotificationEvent" USING
by value empdepId by value aTheData.
INVOKE SELF "notifyObservers" using by value event.
INVOKE event "somFree".
GOBACK.
END METHOD "setEmpdep".
* METHOD
IDENTIFICATION DIVISION.
METHOD-ID. "getEmpfone".
DATA DIVISION.
LOCAL-STORAGE SECTION.
LINKAGE SECTION.
01 Empfone.
03 Empfone-Length PIC 9(9) COMP-5.
03 Empfone-String.
05 Empfone-Chars PIC X
OCCURS 1 TO 255 TIMES
DEPENDING ON Empfone-Length.
01 rc PIC S9(9) USAGE COMP-5.
PROCEDURE DIVISION
RETURNING Empfone.
MOVE iEmpfone-Length TO Empfone-length.
MOVE iEmpfone-String TO Empfone-string.
GOBACK.
END METHOD "getEmpfone".
* METHOD
IDENTIFICATION DIVISION.
METHOD-ID. "setEmpfone".
DATA DIVISION.
LOCAL-STORAGE SECTION.
01 aTheData USAGE OBJECT REFERENCE TheData.
01 event USAGE OBJECT REFERENCE CNotificationEvent.
01 empfoneId USAGE POINTER.
LINKAGE SECTION.
01 Empfone.
03 Empfone-Length PIC 9(9) COMP-5.
03 Empfone-String.
05 Empfone-Chars PIC X
OCCURS 1 TO 255 TIMES
DEPENDING ON Empfone-Length.
01 rc PIC S9(9) USAGE COMP-5.
PROCEDURE DIVISION USING Empfone.
MOVE Empfone-Length TO iEmpfone-length.
MOVE Empfone-String TO iEmpfone-string.
INVOKE CNotificationEvent "somNew" returning event.
SET aTheData TO SELF.
INVOKE SELF "getEmpfoneId"
RETURNING empfoneId.
INVOKE event "initializeNotificationEvent" USING
by value empfoneId by value aTheData.
INVOKE SELF "notifyObservers" using by value event.
INVOKE event "somFree".
GOBACK.
END METHOD "setEmpfone".
* METHOD
IDENTIFICATION DIVISION.
METHOD-ID. "getEmphire".
DATA DIVISION.
LOCAL-STORAGE SECTION.
LINKAGE SECTION.
01 Emphire.
03 Emphire-Length PIC 9(9) COMP-5.
03 Emphire-String.
05 Emphire-Chars PIC X
OCCURS 1 TO 255 TIMES
DEPENDING ON Emphire-Length.
01 rc PIC S9(9) USAGE COMP-5.
PROCEDURE DIVISION
RETURNING Emphire.
MOVE iEmphire-Length TO Emphire-length.
MOVE iEmphire-String TO Emphire-string.
GOBACK.
END METHOD "getEmphire".
* METHOD
IDENTIFICATION DIVISION.
METHOD-ID. "setEmphire".
DATA DIVISION.
LOCAL-STORAGE SECTION.
01 aTheData USAGE OBJECT REFERENCE TheData.
01 event USAGE OBJECT REFERENCE CNotificationEvent.
01 emphireId USAGE POINTER.
LINKAGE SECTION.
01 Emphire.
03 Emphire-Length PIC 9(9) COMP-5.
03 Emphire-String.
05 Emphire-Chars PIC X
OCCURS 1 TO 255 TIMES
DEPENDING ON Emphire-Length.
01 rc PIC S9(9) USAGE COMP-5.
PROCEDURE DIVISION USING Emphire.
MOVE Emphire-Length TO iEmphire-length.
MOVE Emphire-String TO iEmphire-string.
INVOKE CNotificationEvent "somNew" returning event.
SET aTheData TO SELF.
INVOKE SELF "getEmphireId"
RETURNING emphireId.
INVOKE event "initializeNotificationEvent" USING
by value emphireId by value aTheData.
INVOKE SELF "notifyObservers" using by value event.
INVOKE event "somFree".
GOBACK.
END METHOD "setEmphire".
* METHOD
IDENTIFICATION DIVISION.
METHOD-ID. "getEmpserv".
DATA DIVISION.
LOCAL-STORAGE SECTION.
LINKAGE SECTION.
01 Empserv.
03 Empserv-Length PIC 9(9) COMP-5.
03 Empserv-String.
05 Empserv-Chars PIC X
OCCURS 1 TO 255 TIMES
DEPENDING ON Empserv-Length.
01 rc PIC S9(9) USAGE COMP-5.
PROCEDURE DIVISION
RETURNING Empserv.
MOVE iEmpserv-Length TO Empserv-length.
MOVE iEmpserv-String TO Empserv-string.
GOBACK.
END METHOD "getEmpserv".
* METHOD
IDENTIFICATION DIVISION.
METHOD-ID. "setEmpserv".
DATA DIVISION.
LOCAL-STORAGE SECTION.
01 aTheData USAGE OBJECT REFERENCE TheData.
01 event USAGE OBJECT REFERENCE CNotificationEvent.
01 empservId USAGE POINTER.
LINKAGE SECTION.
01 Empserv.
03 Empserv-Length PIC 9(9) COMP-5.
03 Empserv-String.
05 Empserv-Chars PIC X
OCCURS 1 TO 255 TIMES
DEPENDING ON Empserv-Length.
01 rc PIC S9(9) USAGE COMP-5.
PROCEDURE DIVISION USING Empserv.
MOVE Empserv-Length TO iEmpserv-length.
MOVE Empserv-String TO iEmpserv-string.
INVOKE CNotificationEvent "somNew" returning event.
SET aTheData TO SELF.
INVOKE SELF "getEmpservId"
RETURNING empservId.
INVOKE event "initializeNotificationEvent" USING
by value empservId by value aTheData.
INVOKE SELF "notifyObservers" using by value event.
INVOKE event "somFree".
GOBACK.
END METHOD "setEmpserv".
* METHOD
IDENTIFICATION DIVISION.
METHOD-ID. "getProcessIDX".
DATA DIVISION.
LOCAL-STORAGE SECTION.
LINKAGE SECTION.
01 ProcessIDX PIC 9(9) COMP-5.
01 rc PIC S9(9) USAGE COMP-5.
PROCEDURE DIVISION
RETURNING ProcessIDX.
MOVE iProcessIDX TO ProcessIDX.
GOBACK.
END METHOD "getProcessIDX".
* METHOD
IDENTIFICATION DIVISION.
METHOD-ID. "setProcessIDX".
DATA DIVISION.
LOCAL-STORAGE SECTION.
01 aTheData USAGE OBJECT REFERENCE TheData.
01 event USAGE OBJECT REFERENCE CNotificationEvent.
01 processIDXId USAGE POINTER.
* Begin hand coded extensions to the action
01 ADataB.
COPY 'dataarea.cpy'.
01 Contents.
03 Contents-Length PIC 9(9) COMP-5.
03 Contents-String.
05 Contents-Chars PIC X
OCCURS 1 TO 255 TIMES
DEPENDING ON Contents-Length.
01 ArrayIDX PIC 9(9) COMP-5.
* End hand coded extensions
LINKAGE SECTION.
01 ProcessIDX PIC 9(9) COMP-5.
01 rc PIC S9(9) USAGE COMP-5.
PROCEDURE DIVISION USING ProcessIDX.
MOVE ProcessIDX TO iProcessIDX.
* Begin hand coded extensions
*----------------------------------
* The input value (ProcessIDX) is the key of the Container record
* that was selected. That key must be massaged to reflect the
* fact that the list could have been generated several times
* and the keys are not reused. Hence, the beginning key of
* this list must be subtracted from the key of the selected
* record in order to get the correct offset into the array
* of saved records.
*
Invoke SELF "getFirstRecID" RETURNING ArrayIDX
Subtract ProcessIDX from ArrayIDX GIVING ArrayIDX
Add 1 to ArrayIDX
Invoke SELF "getAdataBlk" RETURNING ADataB
* Use the computed array index
Move cs-Emp-Last-Len(ArrayIDX) to Contents-Length
Move cs-Emp-Last-Data(ArrayIDX) to Contents-String
Invoke SELF "setEmpLastn" USING Contents
Move cs-Emp-First-Len(ArrayIDX) to Contents-Length
Move cs-Emp-First-Data(ArrayIDX) to Contents-String
Invoke SELF "setEmpFirstn" USING Contents
Move 1 to Contents-Length
Move cs-Emp-Initial(ArrayIDX) to Contents-String
Invoke SELF "setEmpMidn" USING Contents
Move 3 to Contents-Length
Move cs-Emp-Dept(ArrayIDX) to Contents-string
INVOKE SELF "setEmpdep" USING Contents
Move 4 to Contents-Length
Move cs-Emp-Phone(ArrayIDX) to Contents-string
Invoke SELF "setEmpfone" USING Contents
Move 10 to Contents-Length
Move cs-Emp-Hire-Date(ArrayIDX) to Contents-string
Invoke SELF "setEmphire" USING Contents
Move 2 to Contents-Length
Move cs-Service-Length(ArrayIDX) to Contents-string
Invoke SELF "setEmpserv" USING Contents
*----------------------------------
* End hand coded extensions
INVOKE CNotificationEvent "somNew" returning event.
SET aTheData TO SELF.
INVOKE SELF "getProcessIDXId"
RETURNING processIDXId.
INVOKE event "initializeNotificationEvent" USING
by value processIDXId by value aTheData.
INVOKE SELF "notifyObservers" using by value event.
INVOKE event "somFree".
GOBACK.
END METHOD "setProcessIDX".
* METHOD
IDENTIFICATION DIVISION.
METHOD-ID. "getEmplastn".
DATA DIVISION.
LOCAL-STORAGE SECTION.
LINKAGE SECTION.
01 Emplastn.
03 Emplastn-Length PIC 9(9) COMP-5.
03 Emplastn-String.
05 Emplastn-Chars PIC X
OCCURS 1 TO 255 TIMES
DEPENDING ON Emplastn-Length.
01 rc PIC S9(9) USAGE COMP-5.
PROCEDURE DIVISION
RETURNING Emplastn.
MOVE iEmplastn-Length TO Emplastn-length.
MOVE iEmplastn-String TO Emplastn-string.
GOBACK.
END METHOD "getEmplastn".
* METHOD
IDENTIFICATION DIVISION.
METHOD-ID. "setEmplastn".
DATA DIVISION.
LOCAL-STORAGE SECTION.
01 aTheData USAGE OBJECT REFERENCE TheData.
01 event USAGE OBJECT REFERENCE CNotificationEvent.
01 emplastnId USAGE POINTER.
LINKAGE SECTION.
01 Emplastn.
03 Emplastn-Length PIC 9(9) COMP-5.
03 Emplastn-String.
05 Emplastn-Chars PIC X
OCCURS 1 TO 255 TIMES
DEPENDING ON Emplastn-Length.
01 rc PIC S9(9) USAGE COMP-5.
PROCEDURE DIVISION USING Emplastn.
MOVE Emplastn-Length TO iEmplastn-length.
MOVE Emplastn-String TO iEmplastn-string.
INVOKE CNotificationEvent "somNew" returning event.
SET aTheData TO SELF.
INVOKE SELF "getEmplastnId"
RETURNING emplastnId.
INVOKE event "initializeNotificationEvent" USING
by value emplastnId by value aTheData.
INVOKE SELF "notifyObservers" using by value event.
INVOKE event "somFree".
GOBACK.
END METHOD "setEmplastn".
* METHOD
IDENTIFICATION DIVISION.
METHOD-ID. "getEmpfirstn".
DATA DIVISION.
LOCAL-STORAGE SECTION.
LINKAGE SECTION.
01 Empfirstn.
03 Empfirstn-Length PIC 9(9) COMP-5.
03 Empfirstn-String.
05 Empfirstn-Chars PIC X
OCCURS 1 TO 255 TIMES
DEPENDING ON Empfirstn-Length.
01 rc PIC S9(9) USAGE COMP-5.
PROCEDURE DIVISION
RETURNING Empfirstn.
MOVE iEmpfirstn-Length TO Empfirstn-length.
MOVE iEmpfirstn-String TO Empfirstn-string.
GOBACK.
END METHOD "getEmpfirstn".
* METHOD
IDENTIFICATION DIVISION.
METHOD-ID. "setEmpfirstn".
DATA DIVISION.
LOCAL-STORAGE SECTION.
01 aTheData USAGE OBJECT REFERENCE TheData.
01 event USAGE OBJECT REFERENCE CNotificationEvent.
01 empfirstnId USAGE POINTER.
LINKAGE SECTION.
01 Empfirstn.
03 Empfirstn-Length PIC 9(9) COMP-5.
03 Empfirstn-String.
05 Empfirstn-Chars PIC X
OCCURS 1 TO 255 TIMES
DEPENDING ON Empfirstn-Length.
01 rc PIC S9(9) USAGE COMP-5.
PROCEDURE DIVISION USING Empfirstn.
MOVE Empfirstn-Length TO iEmpfirstn-length.
MOVE Empfirstn-String TO iEmpfirstn-string.
INVOKE CNotificationEvent "somNew" returning event.
SET aTheData TO SELF.
INVOKE SELF "getEmpfirstnId"
RETURNING empfirstnId.
INVOKE event "initializeNotificationEvent" USING
by value empfirstnId by value aTheData.
INVOKE SELF "notifyObservers" using by value event.
INVOKE event "somFree".
GOBACK.
END METHOD "setEmpfirstn".
* METHOD
IDENTIFICATION DIVISION.
METHOD-ID. "getEmpmidn".
DATA DIVISION.
LOCAL-STORAGE SECTION.
LINKAGE SECTION.
01 Empmidn.
03 Empmidn-Length PIC 9(9) COMP-5.
03 Empmidn-String.
05 Empmidn-Chars PIC X
OCCURS 1 TO 255 TIMES
DEPENDING ON Empmidn-Length.
01 rc PIC S9(9) USAGE COMP-5.
PROCEDURE DIVISION
RETURNING Empmidn.
MOVE iEmpmidn-Length TO Empmidn-length.
MOVE iEmpmidn-String TO Empmidn-string.
GOBACK.
END METHOD "getEmpmidn".
* METHOD
IDENTIFICATION DIVISION.
METHOD-ID. "setEmpmidn".
DATA DIVISION.
LOCAL-STORAGE SECTION.
01 aTheData USAGE OBJECT REFERENCE TheData.
01 event USAGE OBJECT REFERENCE CNotificationEvent.
01 empmidnId USAGE POINTER.
LINKAGE SECTION.
01 Empmidn.
03 Empmidn-Length PIC 9(9) COMP-5.
03 Empmidn-String.
05 Empmidn-Chars PIC X
OCCURS 1 TO 255 TIMES
DEPENDING ON Empmidn-Length.
01 rc PIC S9(9) USAGE COMP-5.
PROCEDURE DIVISION USING Empmidn.
MOVE Empmidn-Length TO iEmpmidn-length.
MOVE Empmidn-String TO iEmpmidn-string.
INVOKE CNotificationEvent "somNew" returning event.
SET aTheData TO SELF.
INVOKE SELF "getEmpmidnId"
RETURNING empmidnId.
INVOKE event "initializeNotificationEvent" USING
by value empmidnId by value aTheData.
INVOKE SELF "notifyObservers" using by value event.
INVOKE event "somFree".
GOBACK.
END METHOD "setEmpmidn".
* METHOD
IDENTIFICATION DIVISION.
METHOD-ID. "getFirstRecID".
DATA DIVISION.
LOCAL-STORAGE SECTION.
LINKAGE SECTION.
01 FirstRecID PIC 9(9) COMP-5.
01 rc PIC S9(9) USAGE COMP-5.
PROCEDURE DIVISION
RETURNING FirstRecID.
MOVE iFirstRecID TO FirstRecID.
GOBACK.
END METHOD "getFirstRecID".
* METHOD
IDENTIFICATION DIVISION.
METHOD-ID. "setFirstRecID".
DATA DIVISION.
LOCAL-STORAGE SECTION.
01 aTheData USAGE OBJECT REFERENCE TheData.
01 event USAGE OBJECT REFERENCE CNotificationEvent.
01 FirstRecIDId USAGE POINTER.
LINKAGE SECTION.
01 FirstRecID PIC 9(9) COMP-5.
01 rc PIC S9(9) USAGE COMP-5.
PROCEDURE DIVISION USING FirstRecID.
MOVE FirstRecID TO iFirstRecID.
INVOKE CNotificationEvent "somNew" returning event.
SET aTheData TO SELF.
INVOKE SELF "getFirstRecIDId"
RETURNING FirstRecIDId.
INVOKE event "initializeNotificationEvent" USING
by value FirstRecIDId by value aTheData.
INVOKE SELF "notifyObservers" using by value event.
INVOKE event "somFree".
GOBACK.
END METHOD "setFirstRecID".
* Feature source code generation ends here.