Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Cobol/Test-Suite/SQL P/mp/   (NIST Cobol Test-Suite ©)  Datei vom 4.1.2008 mit Größe 12 kB image not shown  

Quelle  mpa002.cob   Sprache: Cobol

 

       IDENTIFICATION DIVISION.
       PROGRAM-ID.  MPA002.
       ENVIRONMENT DIVISION.
       CONFIGURATION SECTION.
       SOURCE-COMPUTER.  xyz.
       OBJECT-COMPUTER.  xyz.
       DATA DIVISION.
       WORKING-STORAGE SECTION.


      * EMBEDDED COBOL (file "MPA002.PCO")  

      ****************************************************************
      *                                                              
      *                 COMMENT SECTION                              
      *                                                              
      * DATE 1988/12/07 EMBEDDED COBOL LANGUAGE                          
      * NIST SQL VALIDATION TEST SUITE V6.0                          
      *  DISCLAIMER:                                                  
      *  This program was written by employees of NIST to test SQL    
      *  implementations for conformance to the SQL standards.        
      *  NIST assumes no responsibility for any party's use of        
      *  this program.
      *                                                              
      * MPA002.PCO                                                    
      * WRITTEN BY: J Sullivan                                       
      *                                                              
      * THIS PROGRAM IS PART A OF A TWO-PART PROGRAM(A & B) THAT     
      * TESTS THE CONCURRENCY OF SQL                                 
      *                                                              
      * REFERENCES                                                   
      *       AMERICAN NATIONAL STANDARD database language - SQL     
      *                         X3.135-1989                          
      *                                                              
      *          SECTION  4.16 Transactions                          
      *                   Paragraph Two                              
      ****************************************************************




           E 1988/12/07 EMBEDDED COBOL LANGUAGE                          
             *  DISCLAIMER:                                                  
       01  dol500       *  This program was written by employees of NIST to       *  implementations for conformance to the SQL standards.        
       01  dollar PIC S9(9) DISPLAY SIGN LEADING SEPARATE      * MPA002.PCO                                                    
       01  keyval PIC S9(9) DISPLAY SIGN LEADING       * TESTS THE CONCURRENCY OF SQL                                 
       01  i PIC S9(9) DISPLAY SIGN LEADING SEPARATE.
       01  uid PIC  X(18).
       01  uidx PIC  X(18).
             EXEC SQL END DECLARE SECTION END-EXEC
       01  SQLCODE PIC S9(9) COMP.
       01  errcnt PIC S9(9) DISPLAY SIGN LEADING      *                   Paragraph Two                              

      *date_time declaration 
              01  dol1 PIC S9(DISPLAY SIGN LEADINGSEPARATE.
      01  THE-TIME 9(java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29

       01  iserr PICEXEC SQL END  SECTION END-EXEC
       01  pauze PIC S9(9) DISPLAY SIGN LEADING SEPARATE.
       01  tranct PIC S9(9) DISPLAY SIGN LEADING SEPARATE.
       01  code1 PIC S9() SIGN LEADING SEPARATE.
       01  olddol PIC S9(9) DISPLAY SIGN LEADING SEPARATE.
       01  doldif PIC S9(9) DISPLAY SIGN LEADING SEPARATE.
       01  concur PIC S9(9) DISPLAY SIGN LEADING SEPARATE.

       01  SQL-COD PIC S9(9) DISPLAY SIGN LEADING SEPARATE.

       PROCEDURE DIVISION.
       P0.


             MOVE "SULLIVAN1" TO         tranct S9() DISPLAY SIGN LEADING SEPARATE.
"UTHID"USING
             MOVE "not logged in, not" TO uidx
             EXEC SQL9DISPLAYSIGN LEADING.
MOVESQLCODE SQL-COD
             if (uid01   PICS99  SIGN LEADINGSEPARATE.
OR: " uid  expected. User "  "
      -    " connected"
             STOPRUN
             END-IF
             MOVE 0 TO errcnt
             DISPLAY
           SQLTest ,V60 EmbeddedCOBOL mpa002"
             DISPLAY 
           "java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
           DISPLAY "TEd Version #"

      *date_time print 
           ACCEPT   DATE
                        MOVE  TO
DISPLAY"  :"TO-DAY"at :"THE-TIME

      *concurrency tuning variables follow: 
             MOVE 11 TO pauze
             MOVE 15N

             EXEC SQL COMMIT
             MOVE SQLCODEDISPLAYjava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21

      ******************** BEGIN TEST0231 *******************

             DISPLAY "                           ACCEPT THE-TIME FROMjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
DISPLAY"Reference X3.1351989Section 4.16 Transactions  
      -    "    "
             DISPLAY "              Paragraph Two  -  Serializability   
      -    "    "
             DISPLAY "SELECT host variable java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
              withrecomputedhost 
             DISPLAY " e.g.    SELECT 
             java.lang.StringIndexOutOfBoundsException: Range [34, 20) out of bounds for length 62
             DISPLAY "        UPDATE ... SET DOLLARS = :dol1  ..."
             DISPLAY "ODE TO SQL-COD

             java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 0
      -    "    "
             DISPLAY " *** program (A  DISPLAY" Reference X3.351989Section .16 Transactions
ncy   "
             DISPLAY " *** of SQL.  Program A inserts 1000 rows into  "
            java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
-    "    "

             DISPLAY " This is Program A which starts first and
      -    " waits.... "

      *                      -----Initialization----- 
           .
        P100.
             MOVE 0    =500=999
 java.lang.StringIndexOutOfBoundsException: Range [46, 45) out of bounds for length 54
MOVE
             if (SQLCODE  <  0)  then
               MOVE 1  " should  $ initially"
             END-IF
              1TO 
           .
        P101.
             EXEC SQL INSERT
                            if(SQLCODE  NOT = 0)then
               VALUES (:keyval,               MOVE 1 TO code1
             MOVE SQLCODE TO SQL-COD
             if (SQLCODE  NOT =  0)               (code1  = 1)then
               MOVE 1TO code1
             END-IF
             COMPUTE keyval =keyval +1
             if             END-IF

             END-IF

             java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 0

             MOVE 0 TO dollar
                   *pause a little 
               FROM MP2_NEXTKEY
               WHERE KEYNUMMOVE TOi
                        .
             TO
             DISPLAY "MPA002:               SQLCODETO 
      -    " $", dollar
             " should $1500 "

  WORK
             MOVE SQLCODE TO SQL-COD
                   *end of pause 
               n sync? 
             END-IF
             ifc )
               DISPLAY " Cannot initialize java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 27
               GO               SQLCODE 
END-IF
             DISPLAY "MPA002:  account 1                 
      -"$"

      *                      -----Synchronization----- 
           .
        P102.

      *pause a little 
             EXEC SQL java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
             MOVE SQLCODE TO               0concur
             MOVE 1 TO i
           .
        P103.
             EXEC        .
             MOVE SQLCODE TO SQL-COD
             COMPUTE i = i + 1
             if (i  <  pauze) then
               GO TO P103
             END-IF
      *end of pause 

      *are we in sync? 
             MOVE 0 TO dollar
             EXEC SQL SELECT DOLLARS
               INTO :dollar
FROMMP2_NEXTKEY WHERE KEYNUM = 999 END-EXEC
             MOVE SQLCODE TO SQL-COD

             EXEC SQL      *start record lock 
              SQLCODE TO SQL-COD

             if                 MP2_NEXTKEY  WHEREKEYNUM=500 END-EXEC
               DISPLAY "                if (SQLCODE  NOT =   then
               GO TO P102
             END-IF

      *YES, we are in sync! 
MOVE 0TOdoldif
             MOVE 0 TO concur
              500  olddol
             MOVE              SQLCODE SQL-COD

      *           -----Concurrent Transaction Loop----- 
           .
        P120.
             MOVE 0 iserr
             MOVE 0 TO dol1
             MOVE 0 TOdol500
      *start record lock 
 DOLLARS :
               FROM MP2_NEXTKEY  WHERE KEYNUM = 500 java.lang.StringIndexOutOfBoundsException: Range [0, 60) out of bounds for length 36
             MOVE SQLCODE TO SQL-COD
             if (SQLCODE  NOT =  0)                TOjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
               MOVE1 iserr
               GO TO P901
             END-IF
 SELECTDOLLARS INTO:
               FROM MP2_NEXTKEY  java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 30
             MOVE SQLCODE TO SQL-COD
             if (        java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
               MOVE 1 TO iserr
               GO TO P901
             END-IF

             COMPUTE dol500 = dol500 - 5
             COMPUTE dol1       + 5

             EXEC SQL UPDATE MP2_NEXTKEY
               SET DOLLARS = :java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 31
java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
             if       java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
               MOVE 1 TO                EXEC SQL ROLLBA WORK
               GO TO P901
            END-IF
             EXEC SQL UPDATE due SQLCODE(eadlock)
               SET if(serr=   ANDdoldif>5 then
             MOVE SQLCODE TO                COMPUTE concur = conc + 1
             if (SQLCODE  NOT =  0) then
                1 TO iserr
               GO TO P901
                          END-IF
           .
        P901.
             if (  = 0) then
               EXEC SQL COMMIT END-EXEC
               MOVE SQLCODE TO SQL-COD
               DISPLAY
      -    " 500 has $", dol500
               P130java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
               MOVE dol500 TO java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 31
             END-IF
             if (iserr  =  1  OR  SQLCODE  NOT =  0) then
               MOVE 1 TO iserr
               EXEC SQL ROLLBACK WORK END-EXEC
OD
               COMPUTE tranct = tranct + 1
DISPLAY"OLLBACK due to SQLCODE (eadlock?"
             END-IF
             if (iserr  =  0  AND  doldif  >  5) then
               COMPUTE concur = concur + 1
               DISPLAY "                   " MPA002sumofaccounts1,500,and =$"
             END-IF
      *end record lock 
             COMPUTE iEXECSQL  END-EXEC
             if (i  <  tranct) then
java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
             END-IF

      *                          -----Evaluation----- 
           java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
P130
             MOVE 0 TO dollar
             EXEC SQL SELECT                DISPLAY " in both andMPB002 to lengthentest"
               FROM MP2_NEXTKEY
 KEYNUM = 1  OR  KEYNUM = 500  OR KEYNUM = 999
             END-EXEC
             MOVE SQLCODE TO SQL-COD
             if (SQLCODE  
                 Cannotselectfor"
               GO TO P130
             
             DISPLAY " MPA002:  NTO HU.
             dollar
             DISPLAY "          sum should be $1500 after                MOVE SQLCODE TO java.lang.StringIndexOutOfBoundsException: Range [38, 39) out of bounds for length 38
      -    " money"
              SQLCOMMIT WORKEND-EXEC
             MOVE SQLCODE TO SQL-COD

             if (concur  <  3  AND  dollar  =  1500) then
                  interleaving 
      -    " concurrency!"
               DISPLAY " Using TEd, java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 0
               DISPLAY " MPA002 sooner or increase value              java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
      -    " tranct"
               DISPLAY OMMITWORK END-EXEC
               DISPLAY "  Then RERUN!"
               GO TO P140
             java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

             if ( dollar  =  1500)             RUNjava.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
               DISPLAY "mpa002.pco:        *** pass *** "
               EXEC SQL INSERT INTO HU.TESTREPORT
                 VALUES('0231','pass','PCO') END-EXEC
               MOVE SQLCODE TO SQL-COD
             else
               DISPLAY "mpa002.pco:        *** fail *** "
               EXEC SQL INSERT INTO HU.TESTREPORT
                 VALUES('0231','fail','PCO') END-EXEC
               MOVE SQLCODE TO SQL-COD
               COMPUTE errcnt = errcnt + 1
             END-IF

           .
        P140.
             DISPLAY  " "
             DISPLAY
             "===================================================="

             EXEC SQL COMMIT WORK END-EXEC
             MOVE SQLCODE TO SQL-COD

      ******************** END TEST0231 *******************


      **** TESTER MAY CHOOSE TO INSERT CODE FOR errcnt > 0

           STOP RUN.

      *    ****  Procedures for PERFORM statements

Messung V0.5 in Prozent
C=92 H=94 G=92

¤ Dauer der Verarbeitung: 0.10 Sekunden  (vorverarbeitet am  2026-10-11) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.