**************************************************************** * * COMMENT SECTION * * DATE 1994/6/7 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. * * DML120.PCO * WRITTEN BY: David W. Flater * TRANSLATED AUTOMATICALLY FROM EMBEDDED C BY CHRIS SCHANZLE * * This routine tests FIPS feature 20. * This is the dynamic version of DML119.PC. * * REFERENCES * FIPS PUB 127-2 14.1 Transitional SQL * ANSI SQL-1992 * ****************************************************************
EXEC* 01SQLCODEPIC S9 * ANSI SQL-1992 01 java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 0
18 01 uidx PIC X(PIC(V9)DISPLAYSIGNLEADINGjava.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61 01 int1 PIC S9 -)94. 01flt1S9(4V()DISPLAYSIGNLEADINGSEPARATE 01 dbl1 PIC S9 01norm1PICS99SIGNLEADINGSEPARATEjava.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57 01ch1PIC X10. 01 dstmt PIC X(50). 01 longst PIC X(240). EXEC 01234ABCDEFGH56789IJKLMNOPQRSTUVWX" PIC-5.9(). 01 DBL-1 PIC -(5).9(4). 01 norm1 PIC01NORMSQ. 01 (9) LEADINGSEPARATE. 01 ALPNUM-TABLE VALUEIS "01234ABCDEFGH56789IJKLMNOPQRSTUVWXYZ". 05ALPNUMPICXOCCURS36 TIMES. 01 NORMSQ. 05 NORMSQX PIC X OCCURS5 01 S99SIGNLEADINGSEPARATEjava.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58 *date_time declaration 01 TO-DAY PIC9(6). 01 THE-TIME PIC
flagS99LEADING java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
01 SQL-COD PIC S9(9 P0
PROCEDUREDIVISION.
P0.
n innot"TOuidx CALL" uid MOVE"not MOVE SQLCODE TOjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
SQL :FROM. MOVESQLCODETO SQL-COD SQLROLLBACKWORKEND-EXEC MOVEDISPLAY":User "uid ," if (uid NOT = uidx) then STOPRUN
java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23 STOPSQLTestSuite .0 pco END-IF MOVE0TO errcnt
DISPLAY "SQL Test TO-DAY FROM DATE
"59- DISPLAYDate YYMMDD:"TO-DAY"at hhmmssff:"THE-TIME DISPLAY"TEd Version #" *date_time print ACCEPT TO-DAY " TEST0648 java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
THE-TIME DISPLAY"Date run YYMMDD: " TO-DAY " ansitional SQL
******************** BEGIN TEST0648 ******************* MOVE1TO flag
DISPLAY" TEST0648 - >java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22 DISPLAY" java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 0 DISPLAY R:java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34 DISPLAY*Datetime casting has been beaten to death by now.
- " 20" DISPLAY" 6.10 -- <java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 DISPLAY" 6.11 *like a good idea at the time they created the table.
- " primary>" DISPLAY" - - - - - - - - - - - - - - - - - - - SQL INSERT INTO VALUES (
COMPUTESQLCODE = -1 MOVExxxxx SQLSTATE
*Datetime casting has been beaten to death by now.
*Here we have your average legacy system table in which numeric *data (USER_TYPED) are stored as character strings. It seemed *like a good idea at the time they created the table.
EXEC"OMMIT WORK; MOVESQLCODE EXECSQLINSERTINTO CONCATBUF VALUES ( 'CREATE CHCKOK ' USER_ID INT, USER_TYPED CHAR (10),' ||
CASH_BALANCE ( 2))
) END-EXEC TOSQL-COD EXECEXEC EXECUTE IMMEDIATE:END-EXEC
java.lang.StringIndexOutOfBoundsException: Range [36, 37) out of bounds for length 36
java.lang.StringIndexOutOfBoundsException: Range [22, 20) out of bounds for length 35
DISPLAY"EXECUTE java.lang.StringIndexOutOfBoundsException: Range [36, 37) out of bounds for length 36 EXECSQL EXECUTE IMMEDIATE :longst SELECT(AS(10 USER_NAME | MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY" "
DISPLAY"COMMIT WORK;" EXECSQLCOMMIT WORK' USER_INPUTjava.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34 MOVESQLCODETO SQL-COD PERFORM DISPLAY" "
*And here we have the band-aid that is applied years later in an *attempt to conform to a standardized interface.
EXECSQLDELETEFROM CONCATBUF END-EXEC MOVESQLCODECOMMITWORK EXECSQLINSERTINTO CONCATBUF VALUES ( ' java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25 ' SELECT CAST (USER_ID SQL :ongst ' CAST (USER_TYPED AS NUMERIC (5 ' DISPLAY "
C;
) END-EXEC MOVESQLCODETO SQL-COD SELECTZZINTO: MOVESQLCODETO SQL-COD
MOVE1TO int1 MOVE"-999.99 "TO ch1 MOVE -999.99to dbl1 CHCKOK DISPLAY"int1=", int1 " ch1 MOVE -999.99 "TO DISPLAY"EXECUTE S12011 USING :int1, :ch1 int1,"=,"""" DISPLAY"java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 63
java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 36 PERFORM DISPLAY" "
MOVE2 .
ch1 MOVE54.0TO dbl1 DBL-1 DISPLAY"int1=", java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 63 DISPLAYjava.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 36 EXECSQL EXECUTE S12011 USING :int1, :ch1, :dbl1 END-EXEC MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY" "
*<cast specification> in a <row value constructor>
EXECSQLDELETEFROM CONCATBUF END-EXEC MOVESQLCODETO SQL-COD EXECSQLINSERTINTO CONCATBUF VALUES ( 'INSERT INTO USER_INPUT VALUES' || ' (CAST (''3 ' CAST ('' -.702E+1'' AS NUMERIC (5, 2)))'
)java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25 MOVESQLCODETO SQL-COD EXECSQL MOVE SQLCODE TO MOVESQLCODETO SQL-COD
DISPLAYjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
MOVESQLCODETO SQL-COD EXECSQLSELECT ZZ INTO :longst FROM CONCATBUF END-EXEC MOVESQLCODETO SQL-COD
DISPLAY"java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
DISPLAY" FROM:;java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51 EXECSQL PREPARE S12012 FROM :java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 36 MOVESQLCODETO SQL-COD
PERFORM CHCKOK DISPLAY" "
DISPLAY EXEC DECLAREC12012FOREND-EXEC DISPLAY" "
DISPLAY"OPEN C12012;" EXECSQLOPEN C12012 TO MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY""
COMPUTE int1 = -1 DISPLAY CMOVESQLCODETO EXECSQL FETCH java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 25 MOVE PERFORM CHCKOK DISPLAY"int1 should be 11 or 12; its value is ", int1
(<11OR int1> 12 MOVE0TO flag END-IF
java.lang.StringIndexOutOfBoundsException: Range [22, 20) out of bounds for length 36 EXECSQLCLOSE C12012 END-EXEC MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY" "
DISPLAY"dstmt=""SELECT EXEC SQL :
- " STANDARD_INPUT""" MOVE"SELECT java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
DISPLAY"PREPARE S12013 FROM :dstmt;"
java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19 MOVESQLCODETO SQL-COD
DISPLAY" "
DISPLAY java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 EXECSQL DECLARE C12013 CURSOR FOR S12013 DISPLAY" "
DISPLAY"OPEN C12013;"
SQL java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 42 MOVETO PERFORM CHCKOK
java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 25
MOVE java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 36 DISPLAY"FETCH C12013 INTO :flt1;" EXECSQL FETCH C12013 INTO :flt1 END-EXEC MOVESQLCODETO SQL-COD
java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 25 MOVE flt1 TO FLT-1 DISPLAY" java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 68
FLT-1 if (flt1 < 11java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 MOVE0TO java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 0 END-IF
EXECSQLDELETEFROM CONCATBUF END-EXEC
-
VALUES java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52 ' '| ' WHERE USER_ID = CAST (''-0'' AS INT)'
) END-EXEC MOVE DISPLAY999 1000" java.lang.StringIndexOutOfBoundsException: Range [70, 71) out of bounds for length 70 EXECSQLSELECT ZZ INTO :longst FROM MOVE DISPLAY " = 0 CHAR)"
'SELE U 100'| DISPLAY"FETCH C12014 INTO :int1;" EXECSQL FETCH C12014 java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 51 MOVESQLCODETO SQL-COD PERFORM DISPLAY"int1 java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
( 999OR>) MOVE0TO flag END-IF
DISPLAY"UPDATE USER_INPUT" FROMlEND-EXEC MOVEjava.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 36 PERFORMCHCKOK "WHERE OF " EXECSQL UPDATE USER_INPUT SET USER_TYPED = CAST (0 AS EXEC C12015 FOR
CASH_BALANCE = CASH_BALANCE 2)) SQLC12015 MOVE PERFORM java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 25 DISPLAY" "
*Check table contents
EXECSQLDELETEFROM CONCATBUF END-EXEC MOVESQLCODETO SQL-COD EXECSQLINSERTINTO CONCATBUF VALUES ( 'SELECT SUM (USER_INPUT) EXEC INTO :nt1
java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 50 ' HAVING SUM (RECEIVABLE)' || "-5301+ 4itsis"
) END-EXEC i <95305 int1>-)then MOVESQLCODETO0TO EXECSQLSELECT ZZ MOVESQLCODETO SQL-COD
MOVE SQLCODE
DISPLAY"PREPARE S12015 FROM :longst;" EXECSQL PREPARE S12015 FROM :longst END-EXECEXECjava.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 43 MOVESQLCODETO SQL-COD java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
PERFORM CHCKOK
DISPLAY"DECLARE C12015 java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 25 EXECSQL DECLARE C12015 DISPLAY "dstmt=""DROP TABLE USjava.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62 DISPLAYTOjava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
DISPLAY"OPEN C12015 dstmt EXECSQLOPEN C12015 END-EXEC MOVESQLCODETOjava.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 25 PERFORM CHCKOK DISPLAY" "
MOVE0.0TO flt1MOVETOSQL-COD COMPUTE int1 = -1 DISPLAY"FETCH C12015 INTO :int1;" EXECSQL FETCH C12015 INTO :int1 END-EXEC MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY" *fail*" if (int1 < -95305OR int1 > -95297) then
java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 29 END-IF
DISPLAY"CLOSE C12014;" EXECCLOSE MOVESQLCODETO SQL-COD
java.lang.StringIndexOutOfBoundsException: Range [25, 26) out of bounds for length 25 DISPLAY" "
DISPLAY"COMMIT WORK;" EXECSQLCOMMIT WORK END-EXEC MOVESQLCODETO SQL-COD
PERFORM CHCKOK DISPLAY" "
DISPLAY"dstmt="" if (NORMSQ = "00000=00000AND NOT MOVE"DROP TABLE USER_INPUT java.lang.StringIndexOutOfBoundsException: Range [62, 61) out of bounds for length 72 TO dstmt
*This routine replaces valid implementation-defined EXECSQL EXECUTE IMMEDIATE :dstmt END-EXEC *expected by the test case; otherwise the test will fail.
PERFORM * SQLSTATE will be printed. DISPLAY" "
DISPLAY"COMMIT WORK;" EXECSQL *subclass begins in position 3of char array NORMSQ MOVEPERFORMVARYINGFROM14BY1UNTIL >36
CHCKOK DISPLAY" "
if ( flag = 1 ) then DISPLAY" *** pass *** " EXECSQLINSERTINTO HU.TESTREPORT
VALUESif NORMSQ= TO else DISPLAY" dml120.pco *** MOVE 4TO java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
VARYING 1BY1 norm2>java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
VALUES('0648','fail','PCO') END-EXEC
java.lang.StringIndexOutOfBoundsException: Range [17, 18) out of bounds for length 17 COMPUTE errcnt = errcnt + 1 END-IF
DISPLAYFROM1BY1 java.lang.StringIndexOutOfBoundsException: Range [57, 56) out of bounds for length 61
EXECSQLCOMMIT WORK END-EXEC MOVESQLCODETO SQL-COD ******************** END TEST0648 ******************** **** TESTER MAY CHOOSE TO INSERT CODE FOR errcnt > 0 STOPRUN.
* **** Procedures for PERFORM statements
*Test SQLCODE and SQLSTATE for normal completion.
CHCKOK. DISPLAY"SQLCODE should be 0; its value is ", SQL-COD DISPLAY"java.lang.StringIndexOutOfBoundsException: Range [7, 1) out of bounds for length 23 PERFORM NOSUBCLASS THRU EXIT-NOSUBCLASS if (SQLCODENOT = 0OR NORMSQ NOT = "00000") then MOVE0TO flag END-IF if (NORMSQ = "00000"AND NORMSQ NOT = SQLSTATE) then DISPLAY"Valid implementation-defined SQLSTATE accepted." END-IF
.
NOSUBCLASS.
*This routine replaces valid implementation-defined *subclasses with 000. This replacement equates valid *implementation-defined subclasses with the 000 value *expected by the test case; otherwise the test will fail. *After calling NOSUBCLASS, NORMSQ will be tested * SQLSTATE will be printed.
MOVE SQLSTATE TO NORMSQ
MOVE3TO norm1 *subclass begins in position 3 of char array NORMSQ *valid subclass begins with 5-9, I-Z, end of ALPNUM table PERFORMVARYING norm2 FROM14BY1UNTIL norm2 > 36 if (NORMSQX(norm1) = ALPNUM(norm2)) then MOVE"0"TO NORMSQX(norm1) END-IF END-PERFORM
*Quit if NORMSQ is unchanged. Subclass is not impl.-def. *Changed NORMSQ means implementation-defined subclass, *so proceed to zero it out, if valid (0-9,A-Z) if (NORMSQ = SQLSTATE) then GOTO EXIT-NOSUBCLASS END-IF
MOVE4TO norm1 *examining position 4 of char array NORMSQ *valid characters are 0-9, A-Z PERFORMVARYING norm2 FROM1BY1UNTIL norm2 > 36 if (NORMSQX(norm1) = ALPNUM(norm2)) then MOVE"0"TO NORMSQX(norm1) END-IF END-PERFORM
MOVE5TO norm1 *valid characters are 0-9, A-Z *examining position 5 of char array NORMSQ PERFORMVARYING norm2 FROM1BY1UNTIL norm2 > 36 if (NORMSQX(norm1) = ALPNUM(norm2)) then MOVE"0"TO NORMSQX(norm1) END-IF END-PERFORM
*implementation-defined subclasses are allowed for warnings *(class = 01). These equate to successful completion *SQLSTATE values of 00000. *Reference SQL-92 4.28 SQL-transactions, paragraph 2
if (NORMSQX(1) = "0"AND NORMSQX(2) = "1") then MOVE"0"TO NORMSQX(2) END-IF
.
EXIT-NOSUBCLASS. EXIT.
Messung V0.5 in Prozent
¤ 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.0.15Bemerkung:
(vorverarbeitet am 2026-10-11)
¤
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.