Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Cobol/Test-Suite/SQL P/dml100-186/     Datei vom 4.1.2008 mit Größe 16 kB image not shown  

Quelle  dml185.cob   Sprache: Cobol

 
       IDENTIFICATION 0 cnt1
       PROGRAM-ID      *expected by the test case; otherwise the test will fail. 
        DIVISIONjava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
       CONFIGURATION SECTION.
       SOURCE-COMPUTER.  xyz.
       OBJECT-COMPUTER.  xyz             DISPLAY COMMIT
       DATA DIVISION.
       WORKING-STORAGE SECTION             DISPLAY "WHERE PORTVAL=java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42


      * EMBEDDED COBOL (file "DML185.PCO")


      ****************************************************************
      *                                                              
      *                 COMMENT SECTION                              
      *                                                              
      * DATE 1996-05-24 EMBEDDED COBOL LANGUAGE                          
      * 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.
      *                                                              
      * DML185.PCO                                                    
      * WRITTEN BY:  Joan Sullivan and David Flater                  
      * TRANSLATED AUTOMATICALLY FROM EMBEDDED C BY CHRIS SCHANZLE
      *                                                              
      * This routine tests Transitional SQL.                         
      *                                                              
      * REFERENCES                                                   
      *   FIPS PUB 127-2 14.2 Intermediate SQL                       
      *   ANSI SQL-1992                                              
      *                                                              
      ****************************************************************




                        DISPLAYjava.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
       01  SQLCODEDISPLAY  WHERE;
       01  SQLSTATE PIC  X(5).
       01  uid PICEXEC SELECT(*  :cnt1
       1   X     
       01  H PIC X(32).
       01  indic1 PIC S9
                   (NORMSQSQLSTATEthen"TABLE CORRECT_OUTPUTCASCADE;"
       01  fltval PIC             EXEC DROP CORRECT_OUTPUT CASCADE
             EXEC SQL END DECLARE SECTION
0   PIC S9DISPLAYSIGN CHCKOK           
       01  norm2              DISPLAY
       01  ALPNUM-TABLE VALUE IS
               "01234ABCDEFGH56789IJKLMNOPQRSTUVWXYZ".
           05  ALPNUM              " should be; DISPLAY "cnt1 should be 1; its
       0                           EXEC SQLjava.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
                 *valid characters are 0-9, A-Z 
       01  errcnt PIC            PERFORM VARYING FROM EY java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
      *date_time declaration 
01TO-DAY
       01  THE-TIME PIC 9(8).
01flag(9)DISPLAY LEADING.

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

       PROCEDURE               SQLCODETO
       P0.

             " "             CHCKOK
CALLAUTHID              "
              "not loggedin not" TO
             EXEC SQL SELECT USER INTOjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
             MOVE SQLCODE TO SQL-COD
              SQL SQLCOMMIT END-EXEC
             MOVE TO
              (uidNOT SQL (    ()java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
                "ERROR User PERFORMCjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
ected                java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
            STOP END-PERFORM
             END-IF
             MOVE  TO

             DISPLAY
           java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
             DISPLAY
"9byte "
             DISPLAY "TEd Version #"
      *date_time print 
           ACCEPT TO-DAY      *(class = 01).  These equate to successful completion 
           ACCEPT THE-TIME SQL INTO*SQLSTATE values of 00000. 
           DISPLAY "Date run YYMMDD: "       *Reference SQL-92 4.28 SQL-transactions, paragraph 2 

      ******************** BEGIN TEST0898 *******************
              1TO

             DISPLAY "java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 17
DISPLAY
             DISPLAY "References:"
             DISPLAY " F#2 -- Basic information schema"
             DISPLAY " 21.2.9 -- COLUMNS view"
             DISPLAY " - - - - - "0" NORMSQX()

             COMPUTE SQLCODEjava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
             MOVE              DISPLAY            

             .
             DISPLAY( CHARDEFAULT
             DISPLAY    C2CHAR   DEFAULT'java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
                  C3DEFAULT===================
             DISPLAY " C4 CHAR(18) DEFAULT NULL,"
             DISPLAY               ""
      -    " 00:02:00',"
             DISPLAY " C6 REAL DEFAULT 3.3E1,"
             DISPLAY "java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
              CREATE
               (C1CHAR(18)   DEFAULT  USER
                CHAR1)     'USER',
               C3 CHAR(18)   DEFAULT  'Hello World',
  NULLjava.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
               C5 TIMESTAMP java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
                  java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
               C6      *    ****  Procedures for PERFORM statementsTABLE
               E SQL TABLE CASCADE
                   *Test SQLCODE and SQLSTATE for normal completion. 
           PERFORM CHCKOK
             DISPLAY  " "

             DISPLAY "COMMIT WORK;"
             EXEC SQL COMMIT " should be 0; its value is ,SQL-COD
             MOVE SQLCODE TO SQL-COD
            
             DISPLAY  " "

             MOVE "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" TO H
              2TO
             DISPLAY " COLUMN_DEF"
             DISPLAY " INTO :H : if( NOT = 0OR NORMSQNOT "00000") then
             DISPLAY " FROM INFO_SCHEM.COLUMNS"
                 =''"
             DISPLAY " AND DISPLAY "
             DISPLAY " AND COLUMN_DEF END-IF
             EXEC SQL
               INTO indic1
               FROMINFO_SCHEMCOLUMNS
               WHEREthen
               AND TABLE_NAME = 'XX'
A   USER
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
              indic1beitsis java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
             DISPLAY "H SQLCODE TO SQL-COD
             if (indic1  NOT =  0  OR  H             .
               MOVE 0               " "
             END-IF

             MOVE "" TOH
             MOVE 2 TO indic1
             DISPLAY "SELECT COLUMN_DEF INTO :H :indic1"
O_SCHEMCOLUMNS TABLE_SCHEM
      -    " 'FLATER'"
             DISPLAY " AND TABLE_NAME = 'XX' AND COLUMN_DEF =
      -    " ''USER';"
             EXEC SQL SELECT COLUMN_DEF INTO :H :indic1
               FROM INFO_SCHEM.COLUMNS WHERE TABLE_SCHEM = 'FLATER'
               AND TABLE_NAME           cted the case; otherwise testwill. 
             END-EXEC
             MOVE SQLCODE TO SQL-COD             DISPLAY  " "
           PERFORM CHCKOK
             DISPLAY "indic1 should be 0; its value is ", indic1
DISPLAYHshouldUSERquotesvaluejava.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
             
             if (indic1  NOT =  0  OR  H  NOT  =            3 TO
               MOVE  flag
             END-IF

             MOVE "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" TO H
             MOVE  ifNORMSQX)  (" 
             DISPLAY "SELECT COLUMN_DEF INTO :H :indic1"
             DISPLAY " FROM INFO_SCHEM.COLUMNS WHERE TABLE_SCHEM =
      -    " 'FLATER'"
             END-IF
      -    " World''';"
             EXEC SQL SELECT java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 22
               FROM INFO_SCHEM.COLUMNS WHERE      *Quit if NORMSQ is unchanged.  Subclass is not impl.-def. 
                     *Changed NORMSQ means implementation-defined subclass,    
             END-EXEC
             MOVE SQLCODE TO              SQLDROP TABLE LOSSY_OUTPUT CASCADE
           PERFORM CHCKOK
            DISPLAY"indic1 should be 0; its value is ", indic1
             DISPLAYHs beHello;   , java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
             if (indic1 NOT = 0 OR H NOT 
               MOVE 0 TO flag
             END-IF

             MOVE "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" TO      *examining position 4 of char array NORMSQ 
             MOVE 2EXECSQL WORK VARYINGFROM   1 norm2 6
             DISPLAY "SELECT COLUMN_DEF INTO :H :indic1"
DISPLAY" (NORMSQX() =ALPNUMnorm2)then
      -    " 'FLATER'"
             DISPLAY " AND TABLE_NAME = 'XX' AND COLUMN_DEF = 'NULL';"
             EXEC SQL java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
               FROM INFO_SCHEM.COLUMNS WHEREDISPLAY  ""
               AND TABLE_NAME = 'XX' AND COLUMN_DEF = 'NULL' END-EXEC
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK             if( flag1 )then
             DISPLAY "indic1 should be DISPLAY "                **pass *** "
                             SQL INSERT INTOHU
      -    " ", H
             if (indic1  NOT =  0  OR  H  NOT  =   "NULL" SQLCODE  SQL-COD
               MOVE 0 TO flag
             END-IF

             MOVE "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx END-PERFORM
             MOVE 2 TO indic1
              "SELECT COLUMN_DEF INTO :H :indic1java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
              " FROMINFO_SCHEM.COLUMNS WHERE TABLE_SCHEM =
      -    " 'FLATER'"
             DISPLAY " AND TABLE_NAME = 'XX' AND ORDINAL_POSITION = 5;"
             EXEC SQL SELECT COLUMN_DEF INTO :H :indic1
               FROM INFO_SCHEM.COLUMNS      *SQLSTATE values of 00000. 
               AND TABLE_NAME = 'XX' AND ORDINAL_POSITION = 5 END-EXEC
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY  " "

SPLAY INSERTINTO (, )"
             DISPLAY " VALUES ('Timestamp', CAST (:H:indic1 AS
      -    " TIMESTAMP));"
             EXEC SQL INSERT INTO XXC4C5
               VALUES ('Timestamp', CAST (:H:indic1 AS TIMESTAMP))
             END-EXEC
             MOVE SQLCODE TO SQL-COD
           PERFORM           END-IF
             DISPLAY  " "

             MOVE 0 TO intval
                        .
             DISPLAY" FROM XX WHEREC4 = 'Timestamp'"
             DISPLAY " AND C5 BETWEEN TIMESTAMP '1993-11-10 00:01:00'
      -     AND
             DISPLAY " TIMESTAMP '1993-11-10 00:03:00';"
                          EXECSQL COMMIT WORKjava.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
  FROMXXWHERE C4 'Timestamp
               AND C5 BETWEEN TIMESTAMP '1993-11-10 00:01:00' AND
               TIMESTAMP '1993-11-10 00:03:00' END-EXEC
             MOVE SQLCODE TO SQL-COD      **** TESTER MAY CHOOSE TO INSERT CODE FOR errcnt > 0
PERFORM CHCKOK
             DISPLAY "intval should be 1; its value is ", intval
             if (intval  NOT =  1) then
      *    ****  Procedures for PERFORM statements
             END-IF

             DISPLAY "ROLLBACK java.lang.StringIndexOutOfBoundsException: Range [0, 35) out of bounds for length 0
      *Test SQLCODE and SQLSTATE for normal completion. 
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY  " "

             MOVE 0 TO indic1
             MOVE 0.0 TO fltval
             DISPLAY "SELECT CAST (COLUMN_DEF AS REAL)"
 "INTO : :"
             DISPLAY " FROM INFO_SCHEM.COLUMNS"
             DISPLAY " WHERE TABLE_SCHEM = 'FLATER' AND TABLE_NAME =
      -    " 'XX'"
             DISPLAY " AND ORDINAL_POSITION = 6;"
             EXEC SQL SELECT CAST (COLUMN_DEF AS REAL)
               INTO :fltval :indic1
               FROM INFO_SCHEM.COLUMNS
               WHERETABLE_SCHEM '' AND TABLE_NAME = 'XX'
               AND ORDINAL_POSITION = 6 END-EXEC
             MOVE SQLCODE TO SQL-COD
      *COLUMN_DEF character string value may be 33, 3.3E1, +33, etc. 
           PERFORM CHCKOK
             DISPLAY "indic1 should be 0; its value is ", indic1
             DISPLAY"fltval should be 33 +- 0.1 itsvalue is ", fltval
             if (indic1  NOT =  0  OR  fltvaljava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
             33.1) then
               
             END-IF

             MOVE 0 TO indic1
             DISPLAY "SELECT COLUMN_DEF INTO :H :indic1"
             DISPLAY " FROM INFO_SCHEM.COLUMNS WHERE TABLE_SCHEM =
      -    " 'FLATER'"
             DISPLAY " AND TABLE_NAME = 'XX' AND COLUMN_DEF IS NULL;"
             EXEC SQL SELECT COLUMN_DEF INTO :H      *implementation-defined subclasses with the 000 value     
               FROM INFO_SCHEM      *After calling NOSUBCLASS, NORMSQ will be tested          
               AND TABLE_NAME = 'XX' AND COLUMN_DEF IS NULL END-EXEC
MOVE TOSQL-COD
           PERFORM CHCKOK
             DISPLAY "indic1 should be -1; its value is ", indic1
              indic1 =-) java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
               MOVE 0 TO flag      *subclass begins in position 3 of char array NORMSQ 
             END-IF

             DISPLAY "COMMIT WORK;"
             EXEC SQL             VARYING  FROM 14  1 UNTIL > 36
             MOVE SQLCODE TO SQL-COD
           PERFORM
             DISPLAY  " "

             DISPLAY "DROP TABLE XX CASCADE;"
             EXEC SQL
             MOVE
           PERFORM CHCKOK      *Quit if NORMSQ is unchanged.  Subclass is not impl.-def. 
             DISPLAY  " "

             DISPLAY "COMMIT WORK;"
             EXEC SQL COMMIT WORKifNORMSQSQLSTATE
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY""

             if ( flag  =  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
               DISPLAY " *** pass *** "
               EXEC SQL INSERT INTO HU.TESTREPORT
                 VALUES VARYING    UNTIL
               MOVE SQLCODE TO SQL-COD
             else
               DISPLAY " dml185.pco *** fail *** "
               EXEC SQL INSERT INTO HU.TESTREPORT
                 VALUESEND-IF
               MOVE SQLCODE TO SQL-COD
               COMPUTE errcnt = errcnt + 1
             END-IF

             DISPLAY "===========java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10

             EXEC SQL COMMIT WORK END-EXEC
             MOVE SQLCODE TO SQL-COD
      ******************** END TEST0898 ********************
      **** TESTER MAY CHOOSE TO INSERT CODE FOR errcnt > 0
           STOP RUN.

      *    ****  Procedures for PERFORM statements

      *Test SQLCODE and SQLSTATE for normal completion. 
       .
             DISPLAY "SQLCODE should be 0; its value is ", SQL-COD
             DISPLAY "SQLSTATE should be 00000; its value is ", SQLSTATE
             PERFORM NOSUBCLASS THRU EXIT-NOSUBCLASS
             if (SQLCODE NOT =  0  OR   NORMSQ NOT = "00000"then
               MOVE 0 TO flag
             END-IF
             if (NORMSQ = "00000"      *Reference SQL-92 4.28 SQL-transactions, paragraph 2 
             then
               DISPLAY "Valid implementation-defined (NORMSQX(1) = "0  AND  (2)  =  "")then
             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

           MOVE 3 TO norm1
      *subclass begins in position 3 of char array NORMSQ 
      *valid subclass begins with 5-9, I-Z, end of ALPNUM table 
           PERFORM VARYING norm2 FROM 14 BY 1 UNTIL 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
             GO TO EXIT-NOSUBCLASS
           END-IF

           MOVE 4 TO norm1
      *examining position 4 of char array NORMSQ 
      *valid characters are 0-9, A-Z 
           PERFORM VARYING norm2 FROM 1 BY 1 UNTIL norm2 > 36
           if (NORMSQX(norm1)  =  ALPNUM(norm2)) then
             MOVE "0" TO NORMSQX(norm1)
           END-IF
           END-PERFORM
          
           MOVE 5 TO norm1
      *valid characters are 0-9, A-Z 
      *examining position 5 of char array NORMSQ 
           PERFORM VARYING norm2 FROM 1 BY 1 UNTIL 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.

95%


¤ Dauer der Verarbeitung: 0.14 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

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 ist noch experimentell.