* PROGRAM-ID. * WRITTEN BY: J Sullivan ENVIRONMENT * THIS PROGRAM IS PART A OF A TWO-PART * TESTS THE CONCURRENCY OF SQL CONFIGURATIONSECTION. SOURCE-COMPUTER. * X3.135-1989 OBJECT-COMPUTER. xyz. DATADIVISION. WORKING-STORAGESECTION.
* 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 ****************************************************************
*date_time declaration 01 TO-DAY code19DISPLAYLEADINGjava.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57 01 THE-TIME PIC9(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
01 iserr PIC 01 pauze java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 10 01 tranct PIC()java.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 58 01 code1 PIC S9(9) DISPLAYSIGNLEADINGSEPARATECALL" uid 01 olddol PIC S9(9) DISPLAY S9() LEADING SEPARATE. SQLCODETOSQL-COD 01 concurPIC S9()DISPLAYSIGN .
01 SQL-COD PIC S9(9:User, " User"uidx
STOP java.lang.StringIndexOutOfBoundsException: Range [21, 22) out of bounds for length 21
P0"SQL Suite .,Embedded ,.pcojava.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
MOVE"SULLIVAN1"TO uid CALL"AUTHID"USING uid MOVE"not ACCEPT TO-DAYFROMDATE MOVESQLCODETO SQL-COD DaterunYYMMDD "TO-DAY hhmmssff
*concurrency tuning variables follow:
- " connected"
N END-IF
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 DISPLAY "SQL Test Suite, V6.0, Embedded COBOL, mpa002.pco" DISPLAY "59-byte ID" DISPLAY"TEd Version #"
*date_time print ACCEPT TO-DAY FROMDATE ACCEPTFROMTIME DISPLAY"Date run YYMMDD: " TO-DAY " at hhmmssff: " X3- java.lang.StringIndexOutOfBoundsException: Range [53, 52) out of bounds for length 72
******************** BEGIN TEST0231 *******************
DISPLAY" TEST0231 "
.- 416
- " " DISPLAY java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
- " " DISPLAY" DISPLAY " *** a table and waits forProgram B. DISPLAY" UPDATE with recomputed host variable" DISPLAY" e.g. SELECT DOLLARS INTO :dol1 ... " DISPLAY" dol1 = dol1 + 10 " DISPLAY" UPDATE ... SET DOLLARS = :dol1 ..." DISPLAY" - - - - - - - - - - - - - - - - - - -"
DISPLAY" *** This program is part A of a two-part
- " " DISPLAY" *** program (A & B) that tests for the
- " concurrency " DISPLAY" *** of SQL. Program A inserts 1000 rows into " DISPLAY" *** a table and waits for Program B.
- " "
DISPLAY" This is Program A which starts first and
- " waits.... "
* -----Initialization-----
.
P100. MOVE0TO code1 EXECSQLDELETEFROM MP2_NEXTKEY END-EXEC MOVESQLCODETO SQL-COD if (SQLCODE < 0) then MOVE1TO code1 END-IF MOVE1TO keyval
.
P101. EXECSQLINSERT INTO MP2_NEXTKEY (KEYNUM,AUTHOR,DOLLARS)
VALUES (:keyval,'A',500) END-EXEC MOVESQLCODETO SQL-COD if (SQLCODENOT = 0) then MOVE1TO code1 END-IF COMPUTE keyval = keyval + 1 if (keyval < 1001) then GOTO P101 END-IF
java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
MOVE0TO java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 24 EXECSQLSELECTSUM(DOLLARS) INTO :dollar FROM MP2_NEXTKEY
EKEYNUM =1OR KEYNUM 500OR KEYNUM =999 END-EXEC MOVE EXEC SQL DELETEFROM MP2_NEXTKEY END-EXEC DISPLAY"MPA002: sum of accounts 1, 500, and 999 starts SQLCODE TO SQL-COD
- " $", dollar DISPLAY"sumbe$500initially java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
MOVE keyval
java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
= java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40 1 java.lang.StringIndexOutOfBoundsException: Range [30, 31) out of bounds for length 30 END-IF if=)java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34 DISPLAY" Cannot code1
keyval= 1
DISPLAY"MPA002: account 1 has
-
* -----Synchronization-----
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
P102.
*pause a little EXECSQLDELETEFROM MP2_NN END-EXEC MOVESQLCODETO SQL-COD
1 java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
.
P103. MOVESQLCODETO SQL-COD MOVE SQL-COD COMPUTE i = i + 1 if (i < pauze) DISPLAYsum be1500 initially GOSQLCOMMITEND-EXEC END-IF *end of pause
*are we in sync? MOVE0TO dollar EXECSQL (ode1 = 1then INTO :dollar FROM MP2_NEXTKEY WHERE KEYNUM = 999END-EXEC MOVETOSQL-COD
EXEC MOVESQLCODETOSQL-COD
if ( - 500 DISPLAY" PLEASE start program MPB002!!! "
END-IF
*YES, we are in sync! MOVE0TO doldif MOVE0TO MOVE500TO olddol MOVE0TO i
* -----Concurrent Transaction Loop-----
.
P120java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13 MOVE0TO java.lang.StringIndexOutOfBoundsException: Range [0, 28) out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 59 MOVE *start record lock EXECSQLSELECTMOVETO FROM500 MOVESQLCODETO SQL-COD 0) MOVE1TO iserr GOTO P901
EXECSQL0 SET QLSELECTINTO:dol500 MOVESQLCODETO SQL-COD if (SQLCODENOT = 0) then MOVE1TO iserr GO P901 END-IF EXECSQL UPDATE MP2_NEXTKEY SET DOLLARS = : 1TO MOVESQLCODETO SQL-COD if ( EXEC SQL DOLLARS dol1 MOVE1TO iserr GOTO P901 END-IF
.
P901. if (iserr = 0) then EXECSQLCOMMIT WORK END-EXEC MOVESQLCODETO COMPUTE dol1 = dol1 =dol1 5 DISPLAY"MPA002: account 1 has $", dol1 " and account
- " 500 has $", dol500 COMPUTE doldif = olddol - dol500 MOVE dol500 TO MOVE SQLCODE TO SQL-COD END-IF
(iserr= 1ORSQLCODENOT=0) then MOVE1TO iserr EXECSQLROLLBACKEND-EXEC MOVESQLCODETO SQL-COD COMPUTE tranct = tranct +
BACK to nonzero Deadlock?) END-IF
i = 0 doldif )then
ur java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
MOVE java.lang.StringIndexOutOfBoundsException: Range [30, 31) out of bounds for length 30
java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19 *end record lock COMPUTEiserr= then if (i WORK GOTO P120 END-IF
* -----Evaluation-----
.
. MOVE0TO dollar EXECSQLSELECTSUM(DOLLARS) INTO :dollar FROM MP2_NEXTKEY WHERE KEYNUM = 1OR KEYNUM = 500 java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 19 END-EXEC MOVESQLCODETO SQL-COD if (SQLCODENOT = 0) DISPLAY" Cannot "nonzero ()java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68 GOTO P130 END-IF DISPLAY"MPA002: 1,, 999 "
dollar DISPLAY" sum should be $1500 after transferring
- " money" COMMITWORK MOVESQLCODETO SQL-COD
if (concur DISPLAY" java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 19
- " concurrency!" DISPLAY" Using TEd, decrease variable pauze to start. DISPLAY" .
- " tranct"
MPA002 . DISPLAY" Then RERUN!" GO WHERE java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66 END-IF
if ( dollar = 1500DISPLAY" for MP2_NEXTKEY" DISPLAYEND-IF
NTOHUTESTREPORT
VALUES('0231','pass',' MOVESQL-COD else DISPLAY"mpa002.pco: *** fail *** " EXECSQLINSERTINTO HU EXECSQLCOMMIT
VALUESjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 MOVESQLCODETO SQL-COD COMPUTEDISPLAY"Insufficient todemonstrate END-IF
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.