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 >
Text File  |  1997-08-05  |  13KB  |  353 lines

  1.  
  2.       * Feature source code generation begins here...
  3.       * METHOD
  4.        IDENTIFICATION DIVISION.
  5.        METHOD-ID. "doSearch".
  6.        DATA DIVISION.
  7.        LOCAL-STORAGE SECTION.
  8.            COPY TRANASST.
  9.            05 ECI-COMMAREA REDEFINES ECI-COMMAREA-STRING.
  10.               07  DATE-OUT      PIC X(8).
  11.               07  TIME-OUT      PIC X(8).
  12.        01 ErrorCode.
  13.            03 ErrorCode-Length      PIC 9(9) COMP-5.
  14.            03 ErrorCode-String.
  15.            05 ErrorCode-Chars  PIC X
  16.                   OCCURS 1 TO 255 TIMES
  17.                   DEPENDING ON ErrorCode-Length.
  18.        01 CommDate.
  19.            03 CommDate-Length      PIC 9(9) COMP-5.
  20.            03 CommDate-String.
  21.            05 CommDate-Chars  PIC X
  22.                   OCCURS 1 TO 255 TIMES
  23.                   DEPENDING ON CommDate-Length.
  24.        01 HVsep               PIC X(1)  Value High-Value.
  25.        01 Csep                Pic X(1)  Value ",".
  26.        01 TempDate            PIC X(20).
  27.        01 CommTime.
  28.            03 CommTime-Length      PIC 9(9) COMP-5.
  29.            03 CommTime-String.
  30.            05 CommTime-Chars  PIC X
  31.                   OCCURS 1 TO 255 TIMES
  32.                   DEPENDING ON CommTime-Length.
  33.  
  34.        LINKAGE SECTION.
  35.        PROCEDURE DIVISION .
  36.            MOVE "SYSAD   " TO ECI-USERID.
  37.            MOVE "SYSAD   " TO ECI-PASSWORD.
  38.            MOVE 0          TO ECI-RETURN-CODE.
  39.            MOVE "    "     TO ECI-ABEND-CODE.
  40.            MOVE "TIMEZONE" TO ECI-PROGNAME.
  41.  
  42.       * Beginning of code generated by Transaction Assistant
  43.            CALL "ECICALL" USING
  44.                BY REFERENCE ECI-RETURN-CODE,
  45.                BY REFERENCE ECI-ABEND-CODE,
  46.                BY REFERENCE ECI-USERID,
  47.                BY REFERENCE ECI-PASSWORD,
  48.                BY REFERENCE ECI-COMMAREA,
  49.                BY VALUE 16,
  50.                BY VALUE 60,
  51.                BY VALUE 0,
  52.                BY REFERENCE ECI-PROGNAME,
  53.                BY VALUE -1.
  54.       * End of code generated by Transaction Assistant
  55.  
  56.       * If the ECICALL complete successfully, update the time, date, and
  57.       *  error code.  The date is formatted from a MM-DD-YY format to a
  58.       *  more "readable" form.  The error Message at the bottom of the
  59.       *  window is set to blanks if there is no error.
  60.  
  61.            IF ECI-RETURN-CODE = 0 THEN
  62.               EVALUATE DATE-OUT(1:2)
  63.                  WHEN "01"
  64.                     MOVE "January  " TO CommDate
  65.                  WHEN "02"
  66.                     MOVE "February " TO CommDate
  67.                  WHEN "03"
  68.                     MOVE "March    " TO CommDate
  69.                  WHEN "04"
  70.                     MOVE "April    " TO CommDate
  71.                  WHEN "05"
  72.                     MOVE "May      " TO CommDate
  73.                  WHEN "06"
  74.                     MOVE "June     " TO CommDate
  75.                  WHEN "07"
  76.                     MOVE "July     " TO CommDate
  77.                  WHEN "08"
  78.                     MOVE "August   " TO CommDate
  79.                  WHEN "09"
  80.                     MOVE "September" TO CommDate
  81.                  WHEN "10"
  82.                     MOVE "October  " TO CommDate
  83.                  WHEN "11"
  84.                     MOVE "November " TO CommDate
  85.                  WHEN "12"
  86.                     MOVE "December " TO CommDate
  87.                  WHEN Other
  88.                     MOVE " " TO CommDate
  89.               END-EVALUATE
  90.       * String the "parts" of the date together with the date specified
  91.       *  as a month name and get rid of any blanks in the middle.  Add a
  92.       *  19 in front of the YY, producing a year in the YYYY form.
  93.               Initialize TempDate
  94.               STRING CommDate HVsep DATE-OUT(4:2) Csep HVsep "19"
  95.                   DATE-OUT(7:2) DELIMITED BY SPACES INTO TempDate
  96.               INSPECT TempDate REPLACING ALL High-Value BY SPACES
  97.               MOVE 18 TO CommDate-Length
  98.               MOVE TempDate TO CommDate-String
  99.       * Set the date attribute to send to the date entry field
  100.               INVOKE SELF "setTheDate" USING CommDate
  101.  
  102.               MOVE 8 TO CommTime-Length
  103.               MOVE TIME-OUT TO CommTime-String
  104.       * Set the time attribute to send to the time entry field
  105.               INVOKE SELF "setTheTime" USING CommTime
  106.  
  107.               MOVE 1 TO ErrorCode-Length
  108.               MOVE " " TO ErrorCode-String
  109.       * Set the error code from the call to the CICS Server to the entry field
  110.               INVOKE SELF "setErrorCode" USING ErrorCode
  111.  
  112.       * If the ECICALL produced an error, the time and date fields are
  113.       *  set to blanks and an error message is displayed at the bottom
  114.       *  of the TIMEZONE window.
  115.            ELSE
  116.       * Set the date attribute to send to the date entry field
  117.               MOVE 1 TO CommDate-Length
  118.               MOVE " " TO CommDate-String
  119.               INVOKE SELF "setTheDate" USING CommDate
  120.       * Set the time attribute to send to the time entry field
  121.               MOVE 1 TO CommTime-Length
  122.               MOVE " " TO CommTime-String
  123.               INVOKE SELF "setTheTime" USING CommTime
  124.  
  125.               MOVE 17 TO ErrorCode-Length
  126.               MOVE "CICS ERROR -" TO ErrorCode-String
  127.               MOVE ECI-RETURN-CODE TO ErrorCode-String(13:4)
  128.       * Set the error code from the call to the CICS Server to the entry field
  129.               INVOKE SELF "setErrorCode" USING ErrorCode
  130.            END-IF.
  131.  
  132.            GOBACK.
  133.  
  134.        END METHOD "doSearch".
  135.  
  136.       * METHOD
  137.        IDENTIFICATION DIVISION.
  138.        METHOD-ID. "getTheTime".
  139.        DATA DIVISION.
  140.        LOCAL-STORAGE SECTION.
  141.        LINKAGE SECTION.
  142.        01 TheTime.
  143.            03 TheTime-Length      PIC 9(9) COMP-5.
  144.            03 TheTime-String.
  145.            05 TheTime-Chars  PIC X
  146.                   OCCURS 1 TO 255 TIMES
  147.                   DEPENDING ON TheTime-Length.
  148.        01 rc PIC S9(9) USAGE COMP-5.
  149.        PROCEDURE DIVISION
  150.            RETURNING TheTime.
  151.            MOVE iTheTime-Length TO TheTime-length.
  152.            MOVE iTheTime-String TO TheTime-string.
  153.            GOBACK.
  154.  
  155.        END METHOD "getTheTime".
  156.  
  157.       * METHOD
  158.        IDENTIFICATION DIVISION.
  159.        METHOD-ID. "setTheTime".
  160.        DATA DIVISION.
  161.        LOCAL-STORAGE SECTION.
  162.        01 aECI USAGE OBJECT REFERENCE ECI.
  163.        01 event USAGE OBJECT REFERENCE CNotificationEvent.
  164.        01 theTimeId USAGE POINTER.
  165.        LINKAGE SECTION.
  166.        01 TheTime.
  167.            03 TheTime-Length      PIC 9(9) COMP-5.
  168.            03 TheTime-String.
  169.            05 TheTime-Chars  PIC X
  170.                   OCCURS 1 TO 255 TIMES
  171.                   DEPENDING ON TheTime-Length.
  172.        01 rc PIC S9(9) USAGE COMP-5.
  173.        PROCEDURE DIVISION USING TheTime.
  174.            MOVE TheTime-Length TO iTheTime-length.
  175.            MOVE TheTime-String TO iTheTime-string.
  176.            INVOKE CNotificationEvent "somNew" returning event.
  177.            SET aECI TO SELF.
  178.            INVOKE SELF "getTheTimeId"
  179.               RETURNING theTimeId.
  180.            INVOKE event "initializeNotificationEvent" USING
  181.               by value theTimeId by value aECI.
  182.            INVOKE SELF "notifyObservers" using by value event.
  183.            INVOKE event "somFree".
  184.            GOBACK.
  185.  
  186.        END METHOD "setTheTime".
  187.  
  188.       * METHOD
  189.        IDENTIFICATION DIVISION.
  190.        METHOD-ID. "getTheDate".
  191.        DATA DIVISION.
  192.        LOCAL-STORAGE SECTION.
  193.        LINKAGE SECTION.
  194.        01 TheDate.
  195.            03 TheDate-Length      PIC 9(9) COMP-5.
  196.            03 TheDate-String.
  197.            05 TheDate-Chars  PIC X
  198.                   OCCURS 1 TO 255 TIMES
  199.                   DEPENDING ON TheDate-Length.
  200.        01 rc PIC S9(9) USAGE COMP-5.
  201.        PROCEDURE DIVISION
  202.            RETURNING TheDate.
  203.            MOVE iTheDate-Length TO TheDate-length.
  204.            MOVE iTheDate-String TO TheDate-string.
  205.            GOBACK.
  206.  
  207.        END METHOD "getTheDate".
  208.  
  209.       * METHOD
  210.        IDENTIFICATION DIVISION.
  211.        METHOD-ID. "setTheDate".
  212.        DATA DIVISION.
  213.        LOCAL-STORAGE SECTION.
  214.        01 aECI USAGE OBJECT REFERENCE ECI.
  215.        01 event USAGE OBJECT REFERENCE CNotificationEvent.
  216.        01 theDateId USAGE POINTER.
  217.        LINKAGE SECTION.
  218.        01 TheDate.
  219.            03 TheDate-Length      PIC 9(9) COMP-5.
  220.            03 TheDate-String.
  221.            05 TheDate-Chars  PIC X
  222.                   OCCURS 1 TO 255 TIMES
  223.                   DEPENDING ON TheDate-Length.
  224.        01 rc PIC S9(9) USAGE COMP-5.
  225.        PROCEDURE DIVISION USING TheDate.
  226.            MOVE TheDate-Length TO iTheDate-length.
  227.            MOVE TheDate-String TO iTheDate-string.
  228.            INVOKE CNotificationEvent "somNew" returning event.
  229.            SET aECI TO SELF.
  230.            INVOKE SELF "getTheDateId"
  231.               RETURNING theDateId.
  232.            INVOKE event "initializeNotificationEvent" USING
  233.               by value theDateId by value aECI.
  234.            INVOKE SELF "notifyObservers" using by value event.
  235.            INVOKE event "somFree".
  236.            GOBACK.
  237.  
  238.        END METHOD "setTheDate".
  239.  
  240.       * METHOD
  241.        IDENTIFICATION DIVISION.
  242.        METHOD-ID. "getErrorCode".
  243.        DATA DIVISION.
  244.        LOCAL-STORAGE SECTION.
  245.        LINKAGE SECTION.
  246.        01 ErrorCode.
  247.            03 ErrorCode-Length      PIC 9(9) COMP-5.
  248.            03 ErrorCode-String.
  249.            05 ErrorCode-Chars  PIC X
  250.                   OCCURS 1 TO 255 TIMES
  251.                   DEPENDING ON ErrorCode-Length.
  252.        01 rc PIC S9(9) USAGE COMP-5.
  253.        PROCEDURE DIVISION
  254.            RETURNING ErrorCode.
  255.            MOVE iErrorCode-Length TO ErrorCode-length.
  256.            MOVE iErrorCode-String TO ErrorCode-string.
  257.            GOBACK.
  258.  
  259.        END METHOD "getErrorCode".
  260.  
  261.       * METHOD
  262.        IDENTIFICATION DIVISION.
  263.        METHOD-ID. "setErrorCode".
  264.        DATA DIVISION.
  265.        LOCAL-STORAGE SECTION.
  266.        01 aECI USAGE OBJECT REFERENCE ECI.
  267.        01 event USAGE OBJECT REFERENCE CNotificationEvent.
  268.        01 errorCodeId USAGE POINTER.
  269.        LINKAGE SECTION.
  270.        01 ErrorCode.
  271.            03 ErrorCode-Length      PIC 9(9) COMP-5.
  272.            03 ErrorCode-String.
  273.            05 ErrorCode-Chars  PIC X
  274.                   OCCURS 1 TO 255 TIMES
  275.                   DEPENDING ON ErrorCode-Length.
  276.        01 rc PIC S9(9) USAGE COMP-5.
  277.        PROCEDURE DIVISION USING ErrorCode.
  278.            MOVE ErrorCode-Length TO iErrorCode-length.
  279.            MOVE ErrorCode-String TO iErrorCode-string.
  280.            INVOKE CNotificationEvent "somNew" returning event.
  281.            SET aECI TO SELF.
  282.            INVOKE SELF "getErrorCodeId"
  283.               RETURNING errorCodeId.
  284.            INVOKE event "initializeNotificationEvent" USING
  285.               by value errorCodeId by value aECI.
  286.            INVOKE SELF "notifyObservers" using by value event.
  287.            INVOKE event "somFree".
  288.            GOBACK.
  289.  
  290.        END METHOD "setErrorCode".
  291.  
  292.       * METHOD
  293.        IDENTIFICATION DIVISION.
  294.        METHOD-ID. "updateDate".
  295.        DATA DIVISION.
  296.        LOCAL-STORAGE SECTION.
  297.        LINKAGE SECTION.
  298.        01 CommDate.
  299.            03 CommDate-Length      PIC 9(9) COMP-5.
  300.            03 CommDate-String.
  301.            05 CommDate-Chars  PIC X
  302.                   OCCURS 1 TO 255 TIMES
  303.                   DEPENDING ON CommDate-Length.
  304.        PROCEDURE DIVISION
  305.            RETURNING CommDate.
  306.               INVOKE SELF "getTheDate" RETURNING CommDate.
  307.  
  308.            GOBACK.
  309.  
  310.        END METHOD "updateDate".
  311.  
  312.       * METHOD
  313.        IDENTIFICATION DIVISION.
  314.        METHOD-ID. "updateTime".
  315.        DATA DIVISION.
  316.        LOCAL-STORAGE SECTION.
  317.        LINKAGE SECTION.
  318.        01 CommTime.
  319.            03 CommTime-Length      PIC 9(9) COMP-5.
  320.            03 CommTime-String.
  321.            05 CommTime-Chars  PIC X
  322.                   OCCURS 1 TO 255 TIMES
  323.                   DEPENDING ON CommTime-Length.
  324.        PROCEDURE DIVISION
  325.            RETURNING CommTime.
  326.               INVOKE SELF "getTheTime" RETURNING CommTime.
  327.  
  328.             GOBACK.
  329.  
  330.        END METHOD "updateTime".
  331.  
  332.       * METHOD
  333.        IDENTIFICATION DIVISION.
  334.        METHOD-ID. "updateErrorMsg".
  335.        DATA DIVISION.
  336.        LOCAL-STORAGE SECTION.
  337.        LINKAGE SECTION.
  338.        01 CommReturnCode.
  339.            03 CommReturnCode-Length      PIC 9(9) COMP-5.
  340.            03 CommReturnCode-String.
  341.            05 CommReturnCode-Chars  PIC X
  342.                   OCCURS 1 TO 255 TIMES
  343.                   DEPENDING ON CommReturnCode-Length.
  344.        PROCEDURE DIVISION
  345.            RETURNING CommReturnCode.
  346.               INVOKE SELF "getErrorCode" RETURNING CommReturnCode.
  347.  
  348.            GOBACK.
  349.  
  350.        END METHOD "updateErrorMsg".
  351.  
  352.       * Feature source code generation ends here.
  353.