home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
viscobv6.zip
/
vac22os2
/
ibmcobol
/
samples
/
cicssmp
/
clidir
/
eci.cbv
< prev
next >
Wrap
Text File
|
1997-08-05
|
13KB
|
353 lines
* Feature source code generation begins here...
* METHOD
IDENTIFICATION DIVISION.
METHOD-ID. "doSearch".
DATA DIVISION.
LOCAL-STORAGE SECTION.
COPY TRANASST.
05 ECI-COMMAREA REDEFINES ECI-COMMAREA-STRING.
07 DATE-OUT PIC X(8).
07 TIME-OUT PIC X(8).
01 ErrorCode.
03 ErrorCode-Length PIC 9(9) COMP-5.
03 ErrorCode-String.
05 ErrorCode-Chars PIC X
OCCURS 1 TO 255 TIMES
DEPENDING ON ErrorCode-Length.
01 CommDate.
03 CommDate-Length PIC 9(9) COMP-5.
03 CommDate-String.
05 CommDate-Chars PIC X
OCCURS 1 TO 255 TIMES
DEPENDING ON CommDate-Length.
01 HVsep PIC X(1) Value High-Value.
01 Csep Pic X(1) Value ",".
01 TempDate PIC X(20).
01 CommTime.
03 CommTime-Length PIC 9(9) COMP-5.
03 CommTime-String.
05 CommTime-Chars PIC X
OCCURS 1 TO 255 TIMES
DEPENDING ON CommTime-Length.
LINKAGE SECTION.
PROCEDURE DIVISION .
MOVE "SYSAD " TO ECI-USERID.
MOVE "SYSAD " TO ECI-PASSWORD.
MOVE 0 TO ECI-RETURN-CODE.
MOVE " " TO ECI-ABEND-CODE.
MOVE "TIMEZONE" TO ECI-PROGNAME.
* Beginning of code generated by Transaction Assistant
CALL "ECICALL" USING
BY REFERENCE ECI-RETURN-CODE,
BY REFERENCE ECI-ABEND-CODE,
BY REFERENCE ECI-USERID,
BY REFERENCE ECI-PASSWORD,
BY REFERENCE ECI-COMMAREA,
BY VALUE 16,
BY VALUE 60,
BY VALUE 0,
BY REFERENCE ECI-PROGNAME,
BY VALUE -1.
* End of code generated by Transaction Assistant
* If the ECICALL complete successfully, update the time, date, and
* error code. The date is formatted from a MM-DD-YY format to a
* more "readable" form. The error Message at the bottom of the
* window is set to blanks if there is no error.
IF ECI-RETURN-CODE = 0 THEN
EVALUATE DATE-OUT(1:2)
WHEN "01"
MOVE "January " TO CommDate
WHEN "02"
MOVE "February " TO CommDate
WHEN "03"
MOVE "March " TO CommDate
WHEN "04"
MOVE "April " TO CommDate
WHEN "05"
MOVE "May " TO CommDate
WHEN "06"
MOVE "June " TO CommDate
WHEN "07"
MOVE "July " TO CommDate
WHEN "08"
MOVE "August " TO CommDate
WHEN "09"
MOVE "September" TO CommDate
WHEN "10"
MOVE "October " TO CommDate
WHEN "11"
MOVE "November " TO CommDate
WHEN "12"
MOVE "December " TO CommDate
WHEN Other
MOVE " " TO CommDate
END-EVALUATE
* String the "parts" of the date together with the date specified
* as a month name and get rid of any blanks in the middle. Add a
* 19 in front of the YY, producing a year in the YYYY form.
Initialize TempDate
STRING CommDate HVsep DATE-OUT(4:2) Csep HVsep "19"
DATE-OUT(7:2) DELIMITED BY SPACES INTO TempDate
INSPECT TempDate REPLACING ALL High-Value BY SPACES
MOVE 18 TO CommDate-Length
MOVE TempDate TO CommDate-String
* Set the date attribute to send to the date entry field
INVOKE SELF "setTheDate" USING CommDate
MOVE 8 TO CommTime-Length
MOVE TIME-OUT TO CommTime-String
* Set the time attribute to send to the time entry field
INVOKE SELF "setTheTime" USING CommTime
MOVE 1 TO ErrorCode-Length
MOVE " " TO ErrorCode-String
* Set the error code from the call to the CICS Server to the entry field
INVOKE SELF "setErrorCode" USING ErrorCode
* If the ECICALL produced an error, the time and date fields are
* set to blanks and an error message is displayed at the bottom
* of the TIMEZONE window.
ELSE
* Set the date attribute to send to the date entry field
MOVE 1 TO CommDate-Length
MOVE " " TO CommDate-String
INVOKE SELF "setTheDate" USING CommDate
* Set the time attribute to send to the time entry field
MOVE 1 TO CommTime-Length
MOVE " " TO CommTime-String
INVOKE SELF "setTheTime" USING CommTime
MOVE 17 TO ErrorCode-Length
MOVE "CICS ERROR -" TO ErrorCode-String
MOVE ECI-RETURN-CODE TO ErrorCode-String(13:4)
* Set the error code from the call to the CICS Server to the entry field
INVOKE SELF "setErrorCode" USING ErrorCode
END-IF.
GOBACK.
END METHOD "doSearch".
* METHOD
IDENTIFICATION DIVISION.
METHOD-ID. "getTheTime".
DATA DIVISION.
LOCAL-STORAGE SECTION.
LINKAGE SECTION.
01 TheTime.
03 TheTime-Length PIC 9(9) COMP-5.
03 TheTime-String.
05 TheTime-Chars PIC X
OCCURS 1 TO 255 TIMES
DEPENDING ON TheTime-Length.
01 rc PIC S9(9) USAGE COMP-5.
PROCEDURE DIVISION
RETURNING TheTime.
MOVE iTheTime-Length TO TheTime-length.
MOVE iTheTime-String TO TheTime-string.
GOBACK.
END METHOD "getTheTime".
* METHOD
IDENTIFICATION DIVISION.
METHOD-ID. "setTheTime".
DATA DIVISION.
LOCAL-STORAGE SECTION.
01 aECI USAGE OBJECT REFERENCE ECI.
01 event USAGE OBJECT REFERENCE CNotificationEvent.
01 theTimeId USAGE POINTER.
LINKAGE SECTION.
01 TheTime.
03 TheTime-Length PIC 9(9) COMP-5.
03 TheTime-String.
05 TheTime-Chars PIC X
OCCURS 1 TO 255 TIMES
DEPENDING ON TheTime-Length.
01 rc PIC S9(9) USAGE COMP-5.
PROCEDURE DIVISION USING TheTime.
MOVE TheTime-Length TO iTheTime-length.
MOVE TheTime-String TO iTheTime-string.
INVOKE CNotificationEvent "somNew" returning event.
SET aECI TO SELF.
INVOKE SELF "getTheTimeId"
RETURNING theTimeId.
INVOKE event "initializeNotificationEvent" USING
by value theTimeId by value aECI.
INVOKE SELF "notifyObservers" using by value event.
INVOKE event "somFree".
GOBACK.
END METHOD "setTheTime".
* METHOD
IDENTIFICATION DIVISION.
METHOD-ID. "getTheDate".
DATA DIVISION.
LOCAL-STORAGE SECTION.
LINKAGE SECTION.
01 TheDate.
03 TheDate-Length PIC 9(9) COMP-5.
03 TheDate-String.
05 TheDate-Chars PIC X
OCCURS 1 TO 255 TIMES
DEPENDING ON TheDate-Length.
01 rc PIC S9(9) USAGE COMP-5.
PROCEDURE DIVISION
RETURNING TheDate.
MOVE iTheDate-Length TO TheDate-length.
MOVE iTheDate-String TO TheDate-string.
GOBACK.
END METHOD "getTheDate".
* METHOD
IDENTIFICATION DIVISION.
METHOD-ID. "setTheDate".
DATA DIVISION.
LOCAL-STORAGE SECTION.
01 aECI USAGE OBJECT REFERENCE ECI.
01 event USAGE OBJECT REFERENCE CNotificationEvent.
01 theDateId USAGE POINTER.
LINKAGE SECTION.
01 TheDate.
03 TheDate-Length PIC 9(9) COMP-5.
03 TheDate-String.
05 TheDate-Chars PIC X
OCCURS 1 TO 255 TIMES
DEPENDING ON TheDate-Length.
01 rc PIC S9(9) USAGE COMP-5.
PROCEDURE DIVISION USING TheDate.
MOVE TheDate-Length TO iTheDate-length.
MOVE TheDate-String TO iTheDate-string.
INVOKE CNotificationEvent "somNew" returning event.
SET aECI TO SELF.
INVOKE SELF "getTheDateId"
RETURNING theDateId.
INVOKE event "initializeNotificationEvent" USING
by value theDateId by value aECI.
INVOKE SELF "notifyObservers" using by value event.
INVOKE event "somFree".
GOBACK.
END METHOD "setTheDate".
* METHOD
IDENTIFICATION DIVISION.
METHOD-ID. "getErrorCode".
DATA DIVISION.
LOCAL-STORAGE SECTION.
LINKAGE SECTION.
01 ErrorCode.
03 ErrorCode-Length PIC 9(9) COMP-5.
03 ErrorCode-String.
05 ErrorCode-Chars PIC X
OCCURS 1 TO 255 TIMES
DEPENDING ON ErrorCode-Length.
01 rc PIC S9(9) USAGE COMP-5.
PROCEDURE DIVISION
RETURNING ErrorCode.
MOVE iErrorCode-Length TO ErrorCode-length.
MOVE iErrorCode-String TO ErrorCode-string.
GOBACK.
END METHOD "getErrorCode".
* METHOD
IDENTIFICATION DIVISION.
METHOD-ID. "setErrorCode".
DATA DIVISION.
LOCAL-STORAGE SECTION.
01 aECI USAGE OBJECT REFERENCE ECI.
01 event USAGE OBJECT REFERENCE CNotificationEvent.
01 errorCodeId USAGE POINTER.
LINKAGE SECTION.
01 ErrorCode.
03 ErrorCode-Length PIC 9(9) COMP-5.
03 ErrorCode-String.
05 ErrorCode-Chars PIC X
OCCURS 1 TO 255 TIMES
DEPENDING ON ErrorCode-Length.
01 rc PIC S9(9) USAGE COMP-5.
PROCEDURE DIVISION USING ErrorCode.
MOVE ErrorCode-Length TO iErrorCode-length.
MOVE ErrorCode-String TO iErrorCode-string.
INVOKE CNotificationEvent "somNew" returning event.
SET aECI TO SELF.
INVOKE SELF "getErrorCodeId"
RETURNING errorCodeId.
INVOKE event "initializeNotificationEvent" USING
by value errorCodeId by value aECI.
INVOKE SELF "notifyObservers" using by value event.
INVOKE event "somFree".
GOBACK.
END METHOD "setErrorCode".
* METHOD
IDENTIFICATION DIVISION.
METHOD-ID. "updateDate".
DATA DIVISION.
LOCAL-STORAGE SECTION.
LINKAGE SECTION.
01 CommDate.
03 CommDate-Length PIC 9(9) COMP-5.
03 CommDate-String.
05 CommDate-Chars PIC X
OCCURS 1 TO 255 TIMES
DEPENDING ON CommDate-Length.
PROCEDURE DIVISION
RETURNING CommDate.
INVOKE SELF "getTheDate" RETURNING CommDate.
GOBACK.
END METHOD "updateDate".
* METHOD
IDENTIFICATION DIVISION.
METHOD-ID. "updateTime".
DATA DIVISION.
LOCAL-STORAGE SECTION.
LINKAGE SECTION.
01 CommTime.
03 CommTime-Length PIC 9(9) COMP-5.
03 CommTime-String.
05 CommTime-Chars PIC X
OCCURS 1 TO 255 TIMES
DEPENDING ON CommTime-Length.
PROCEDURE DIVISION
RETURNING CommTime.
INVOKE SELF "getTheTime" RETURNING CommTime.
GOBACK.
END METHOD "updateTime".
* METHOD
IDENTIFICATION DIVISION.
METHOD-ID. "updateErrorMsg".
DATA DIVISION.
LOCAL-STORAGE SECTION.
LINKAGE SECTION.
01 CommReturnCode.
03 CommReturnCode-Length PIC 9(9) COMP-5.
03 CommReturnCode-String.
05 CommReturnCode-Chars PIC X
OCCURS 1 TO 255 TIMES
DEPENDING ON CommReturnCode-Length.
PROCEDURE DIVISION
RETURNING CommReturnCode.
INVOKE SELF "getErrorCode" RETURNING CommReturnCode.
GOBACK.
END METHOD "updateErrorMsg".
* Feature source code generation ends here.