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

Quelle  xop719.cob   Sprache: Cobol

 

       IDENTIFICATION      * X/Open SQL VALIDATION TEST SUITE V6.0                  
             * WRITTEN BY: E. Pratt                                         
       ENVIRONMENT DIVISION      *                                                              
       CONFIGURATION             PROGRAM-ID.  XOP719.PROGRAM-ID.      *       SECTION 5.3.9                                          
       
        Xjava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
       DATA DIVISION.
*   conformance to theSQL .                             

      * Embedded SQL COBOL (file "XOP719.PCO")

      *   Copyright 1994, 1995 X/Open Company Limited  

      *   All rights reserved.                                          
                                                                    *Log on as user XOPEN2 
      *   DISCLAIMER:                                                   
      *   This program was reviewed by employees of NIST for            
      *   conformance to the SQL standards.                             
      *   NIST assumes no responsibility for any party's use of         
      *   this program.                                                 

      *   X/Open and the 'X' symbol are registered trademarks of X/Open Company
      *   Limited in the UK and other countries.


      ****************************************************************
      *                                                              
      *                 COMMENT SECTION                              
      *                                                              
             END-IF
      * X/Open SQL VALIDATION TEST SUITE V6.0                  
      *                                                              
      * XOP719.PCO                                                    
      * WRITTEN BY: E. Pratt                                         
      *                                                              
      * GRANT ALL with optional PRIVILEGES omitted.                  
      *                                                              
      * REFERENCES                                                   
      *       X/Open CAE SQL                                         
      *       SECTION 5.3.9                                          
      *                                                              
      *                <embedded SQL C program>                      
      *                                                              
      * DATE PROGRAM LAST CHANGED   1/11/94                         
      *                                                              
      ****************************************************************

      *Must be run under authorization identifier XOPEN2

      *This test program must be run before xop720.pco, 
      *xop721.pco, xop722.pco, xop723.pco 

           EXEC SQL BEGIN java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
       01  SQLCODE PICDISPLAY   pco,.pco java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
       01  SQLSTATE PIC  X(5 ALLPRIVILEGES
    (.
       01  ch1 PIC  X( "-  --  --  java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
         uid PIC  X(8)
       01  uidx                       X33)
             01DISPLAY**GRANTALLON.;"

       01  errcnt PIC             "**       WHERE B1= 'D' java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
      *date_time declaration 
        9(6).
       01  java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 0
       01errflgjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

      *variables for nosubclass routine 

       01  norm1 PIC S9(      *date_time declaration 
       01  norm2 PICMOVETO
       01  flag S9()DISPLAYSIGN SEPARATE
       01  ALPNUM VALUE              SQLCODETO        01  THE-TIMEPIC 98)
            "1234"
            05 ALPNUM3 PIC X OCCURS 36 TIMES.
       variables for nosubclass routine 
01   REDEFINES .
                   01norm2 PIC()  SIGNLEADING              SQL COMMIT  END-EXEC



  )        

       PROCEDURE      *only for SELECT and CREATE 
       P0E             java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 38


      *Log on as user XOPEN2 
              XOPEN2 
             ifjava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
"not 0 TO
             EXECEND-IF
             *
             if (uid  NOT  =   uidx) then
DISPLAY": "uid  expected  User", uidx "WHEREB1'D END-EXEC
      -    " connected"
java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 21
             END-IF
              zero out if valid (-java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 0
           1 TO
      -            "COBOL, >36
             DISPLAY
           "59-byte ID"
             DISPLAY "TEd Version #"
      *date_time print 
           ACCEPT TO-DAY FROM java.lang.StringIndexOutOfBoundsException: Range [30, 34) out of bounds for length 19
           ACCEPT THE-TIME java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 28
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

             MOVEMOVE1 TOjava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28

      ******************** BEGIN TEST0719 *******************

           java.lang.StringIndexOutOfBoundsException: Range [19, 20) out of bounds for length 19
           DISPLAY " java.lang.StringIndexOutOfBoundsException: Range [13, 1) out of bounds for length 60


           DISPLAY "                           *(class = 01). These equate to successful completion TO       *SQLSTATE values of 00000. 
java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 67
           DISPLAY " java.lang.StringIndexOutOfBoundsException: Range [0, 22) out of bounds for length 0
            "       - - java.lang.StringIndexOutOfBoundsException: Range [0, 35) out of bounds for length 0
                           java.lang.StringIndexOutOfBoundsException: Range [0, 29) out of bounds for length 0
           "*       DISPLAY"   0  java.lang.StringIndexOutOfBoundsException: Range [57, 54) out of bounds for length 68
           DISPLAYPERFORM   P213java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
           "**java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
           DISPLAY "***       WHERE  MOVE 0 
java.lang.StringIndexOutOfBoundsException: Range [20, 18) out of bounds for length 59
"========java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

      *GRANT ALL with optional PRIVILEGES omitted, grantor 

              0TOjava.lang.StringIndexOutOfBoundsException: Range [29, 30) out of bounds for length 29
              1TO flag

      *Clear the tables first 
              FROM XOPEN1.AA END-EXEC
             MOVE SQLCODE TO SQL-COD
              SQL DELETE . END-EXEC
             MOVE SQLCODE TO SQL-COD
              SQL  FROM .CCCEND-EXEC
             MOVE SQLCODE TO SQL-COD
             EXEC SQLCOMMITWORKEND-EXEC
TO

      *Load data into the working database tables 
             EXECDISPLAY"xop719p             * fail *     
             END-EXEC
MOVE TOSQL-COD
             EXEC SQL INSERT              ""
             END-EXEC
             MOVE SQLCODE TO SQL-CODSQLCODETO 
             EXEC SQL INSERT INTO XOPEN1.AAA VALUES('AG'
             END-EXEC
             MOVE SQLCODE 
             EXEC SQL INSERT INTO XOPEN1.AAA VALUES('AJ'      *subclasses with 000. This replacement equates valid   
             END-EXEC
             MOVE SQLCODE TO SQL-COD
             java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 0
             END-EXEC
             MOVE SQLCODE             MOVE 14TOjava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
             EXECSQL  . (' BE, BF)
             END-EXEC
             MOVE SQLCODE TO SQL-COD
              SQL INSERT INTO XOPEN1.BBB VALUES('BG', 'BH', 'BI')
             END-EXEC
             MOVE SQLCODE TO SQL-COD
             EXEC SQL INSERT INTO XOPEN1.BBB VALUES('BJ', 'BK', 'BL')
             END-EXEC
             MOVE SQLCODE TO SQL-COD
              INTO XOPEN1. 'CA', '', '')
             
             MOVE SQLCODE TO SQL-COD
             EXEC SQL INSERT INTO XOPEN1.java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 19
                   *Changed NORMSQ means implementation-defined subclass, 
             MOVE SQLCODE TO SQL-COD
             EXEC SQL INSERT INTO XOPEN1.CCC VALUES('java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
             END-EXEC
             MOVE SQLCODE TO SQL-COD
             EXEC SQL INSERT INTO XOPEN1.CCC

             MOVE SQLCODE TO SQL-COD
             SQLCOMMITWORKEND-EXEC
             MOVE SQLCODE TO SQL-COD

             DISPLAY "==============================================             END-IF
      *Grantor holds all privileges, but has grant option 
      *only for SELECT and CREATE 
             MOVE "x" TO SQLSTATE
             EXEC SQLMOVE1TO
               GRANT OPTION END-EXEC
VE SQLCODE TO SQL-COD
             PERFORM CHCKOK
             if      *SQLSTATE values of 00000. 
                            if((1  =  0'(2)=  1)then
                END-IF
             END-IF

             EXEC SQL COMMIT WORK END-EXEC
             MOVE SQLCODE TO SQL-COD
             DISPLAY "======java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 0
      *Grantor holds SELECT, INSERT, DELETE with GRANT OPTION, 
             MOVE "x" TO SQLSTATE
             EXEC SQL GRANT             DISPLAY " should  be 00000; its value is " SQLSTATE
java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 36
             PERFORM CHCKOK
               NOT  = "0000 OR SQLCODE NOT = 0) then
               DISPLAY "*** Problem found (TEST STEP NUMBER 2) ! *** "
                = + 1
             END-IF
             EXEC java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 19
               TO SQL-COD

             DISPLAY "===             
      *Grantor holds SELECT, INSERT, DELETE with GRANT OPTION, 
             MOVE "x" TO SQLSTATE
             MOVE "  " TO ch1
      *CREATE VIEW XOPEN2V AS SELECT B1, B2, B3 FROM XOPEN1.BBB
             EXEC SQL SELECT B2 INTO :ch1 FROM XOPEN2V 
               WHERE B1 = 'BD' END-EXEC
             MOVE SQLCODE TO SQL-COD
             DISPLAY "SQLSTATE should be 00000, it is ", SQLSTATE
             DISPLAY "ch1 should be BE, it is ", ch1
             PERFORM NOSUBCLASS THROUGH P213.
             if (NORMSQ2 NOT = "00000" OR ch1 NOT = "BE" ) then
               DISPLAY "*** Problem found (TEST STEP NUMBER 3) ! *** "
               COMPUTE errflg = errflg + 1
             END-IF
             EXEC SQL COMMIT WORK END-EXEC
             MOVE SQLCODE TO SQL-COD

             DISPLAY "================================================="
      *Grantor holds INSERT, SELECT only without GRANT OPTION 
      *Expect a warning for no privileges granted below
             MOVE "x" TO SQLSTATE
             MOVE "GRANT ALL ON XOPEN1.CCC TO XOPEN3" TO HCV
              EXEC SQL PREPARE XOP719A FROM :HCV END-EXEC
             MOVE SQLCODE TO SQL-COD
              EXEC SQL EXECUTE XOP719A END-EXEC
              MOVE SQLCODE TO SQL-COD
             DISPLAY "SQLSTATE should be 01007, it is ", SQLSTATE

             if (SQLSTATE  NOT  =   "01007") then
               DISPLAY "*** Problem found (TEST STEP NUMBER 4) ! *** "
               COMPUTE errflg = errflg + 1
             END-IF
              EXEC SQL COMMIT WORK END-EXEC
              MOVE SQLCODE TO SQL-COD
      *No ROLLBACK WORK;-programs follow on from this one e.g.
      *xop720.pco, which require the above grants to exist  

             DISPLAY "number of errors detected is = ", errflg " "
             DISPLAY "### maximum number of errors is 4 ###"

             if (errflg  =  0) then
               EXEC SQL INSERT INTO XOPEN1.TESTREPORT
             VALUES('0719','pass','PCO') END-EXEC
               MOVE SQLCODE TO SQL-COD
               DISPLAY "      xop719.pco             *** pass ***     "
             else
               EXEC SQL INSERT INTO XOPEN1.TESTREPORT
             VALUES('0719','fail','PCO') END-EXEC
               MOVE SQLCODE TO SQL-COD
               COMPUTE errcnt = errcnt + 1
               DISPLAY "      xop719.pco             *** fail ***     "
             END-IF

             DISPLAY "================================================="
             DISPLAY  " "

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

      ******************** END TEST0719 *******************

      ****** TESTER MAY CHOOSE TO INSERT CODE FOR errcnt > 0
             STOP RUN.


       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 SQLSTORE
      *subclass begins in position 3 of char array NORMSQ    
             MOVE 3 TO norm1
             MOVE 14 TO norm2
             PERFORM UNTIL norm2 > 36
             if (NORMSQ(norm1)  =  ALPNUM3(norm2)) then
               MOVE '0' TO NORMSQ(norm1)
             END-IF
              ADD 1 TO norm2
              END-PERFORM
             MOVE SQLS2 TO NORMSQ2
             if (NORMSQ2   =   SQLSTATE) then
               GO TO P213
             END-IF
      *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)        

             MOVE 4 TO norm1
      *examining position 4 of char array NORMSQ             
             MOVE 1 TO norm2
             PERFORM UNTIL norm2 > 36
             if (NORMSQ(norm1)  =  ALPNUM3(norm2)) then
               MOVE '0' TO NORMSQ(norm1)
             END-IF
              ADD 1 TO norm2
              END-PERFORM
             MOVE 5 TO norm1
      *examining position 5 of char array NORMSQ             
             MOVE 1 TO norm2
             PERFORM UNTIL norm2 > 36
             if (NORMSQ(norm1)  =  ALPNUM3(norm2)) then
               MOVE '0' TO NORMSQ(norm1)
             END-IF
              ADD 1 TO norm2
              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 (NORMSQ(1)  =  '0'  AND  NORMSQ(2)  =  '1') then
               MOVE '0' TO NORMSQ(2)
             END-IF
              MOVE SQLS2 TO NORMSQ2.

        P213.

      *Test SQLCODE and SQLSTATE for normal completion 

       CHCKOK.
             MOVE 1 TO flag
             DISPLAY "SQLCODE should be '0'; its value is ", SQL-COD
             DISPLAY "SQLSTATE should be 00000; its value is ", SQLSTATE

             PERFORM NOSUBCLASS THROUGH P213.
             if (SQLCODE  NOT =  0  OR  NORMSQ2  NOT  =   "00000") then
               MOVE 0 TO flag
             END-IF
             if (flag  = 1  AND  NORMSQ2  NOT  =   SQLSTATE) then
               DISPLAY "Valid implementation defined SQLSTATE accepted."
             END-IF

           .



Messung V0.5 in Prozent
C=77 H=100 G=89

¤ Dauer der Verarbeitung: 0.9 Sekunden  ¤

*© 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.