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

Quellcode-Bibliothek dml143.cob   Sprache: Cobol

 
       IDENTIFICATION DIVISION.       IDENTIFICATION DIVISION
       PROGRAM-ID.DML143
       .  DML143
       CONFIGURATION SECTION       CONFIGURATION SECTIONSOURCE-COMPUTERxyzOBJECT-COMPUTERxyz.
       SOURCE-COMPUTER       WORKING-STORAGE SECTION
       OBJECT-COMPUTER.  xyz      * procedures in file "DML143.MCO".
       DATA DIVISION.
       WORKING-STORAGE SECTION      *                                                              


      * Standard COBOL (file "DML143.SCO") calling SQL
      * procedures in file "DML143.MCO".


      ****************************************************************
      *                                                              
      *                 COMMENT SECTION                              
      *                                                              
      * DATE 1994/12/6 STANDARD 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.
      *                                                              
      * DML143.SCO                                                    
      * WRITTEN BY: David Flater                                     
      * TRANSLATED AUTOMATICALLY FROM EMBEDDED COBOL BY CHRIS SCHANZLE
      *                                                              
      * This routine tests a privilege violation.                    
      *                                                              
      * REFERENCES                                                   
      *   6.3 AR.1.a -- <table reference> in <query expression>      
      *                                                              
      ****************************************************************



      * EXEC SQL BEGIN DECLARE SECTION END-EXEC
       01  SQLCODE      * REFERENCES                                                   
       01  SQLSTATE      *                                                              
0java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
1        OBJECT-COMPUTER
      *  EXEC SQL END DECLARE SECTION END-EXEC
      1 PIC S9   LEADING SEPARATE
       01  norm2 PIC0   PIC S9SECTION
       01  ALPNUM-TABLE IS
               " 1ALPNUM-TABLEVALUEIS
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
       01  NORMSQ.
           05  NORMSQX PIC X OCCURS 5 TIMES.
       01  errcnt0124ABCDEFGH56789IJKLMNOPQRSTUVWXYZ.
      *date_time declaration 
       01  TO-DAY PIC 9(6).
       01  THE-TIME PIC 9(8).
       01  flag PIC                                            

       01  SQL-COD PIC       * DATE 1994/12/6 STANDARD COBOL LANGUAGE                             .

        DIVISION.
       P0.

             MOVE "FLATER "       1  errcnt PIC S9      *  DISCLAIMER:                                                        *date_time declaration 
             CALL "AUTHID" USING uid
             MOVE "not logged , not" TO
      *  EXEC SQL SELECT USER INTO :uidx FROM HU.ECCO;
             CALL "SUB1"  SQLCODE SQLSTATE
             
      *  EXEC SQL ROLLBACK WORK;
             CALL "SUB2" USING      *  implementations for conformance to the SQL standards.        
             MOVE SQLCODETO
             ifuid  =   uidx
               DISPLAY "ERROR: * this program.
      -    " .
            
                           "FLATER " TO
             MOVE0TO

             DISPLAY
           "SQL Test Suite, V6.0, Module COBOL, dml143.sco"
      * WRITTEN BY: David Flater                                     
           "59-byte ID"
             DISPLAY " * EXEC SQL SELECT USER INTO :uidx FROM HU.ECCO;
      *date_time print 
            TO-DAY DATE
           ACCEPT THE-TIME TIME
           DISPLAY "Date run YYMMDD: " TO-DAY " * REFERENCES

      ******************** BEGIN TEST0529 *******************
             MOVEMOVE TO SQL-COD      *                                                              

             DISPLAY " java.lang.StringIndexOutOfBoundsException: Range [0, 48) out of bounds for length 34
 "Priv.violation SELECT0norm1PICS99 SIGN LEADING SEPARATE.
             DISPLAYPIC 99  SIGN SEPARATE
DISPLAY    3AR><
      -    " expression>"
             DISPLAY " - - - - - - - - - - .

 SQLCODE.
            COMPUTE -

      *Flater has only INSERT on HU.TESTREPORT.  He should need SELECT
      *for this statement to succeed.                                 

             DISPLAY "INSERT 0 PIC S9(9 DISPLAYSIGNjava.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
                    java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
      *  EXEC SQL INSERT INTO CONCATBUF
      *    SELECT TESTNO FROM HU.TESTREPORT;
                   *  EXEC SQL SELECT USER INTO :uidx FROM HU.ECCO; SQLCODE  SQLSTATE SQLCODE
MOVE java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
  shouldits                0java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
if  NOT<)then
               MOVE 0 TO flag
             END-IF
             DISPLAY "SQLSTATE should be 42000;
           ERFORM THRU             java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
             if             
                0                  " "
END-IF  ""
            OLLBACK;
then
M SQLCODETO SQL-COD
            CHCKOK
   

************               TO
      *  EXEC SQL ROLLBACK WORK;

             MOVE      *      VALUES('0529','pass','MCO');References                   .table--java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25

             if SQLCODE
               DISPLAY  <;value
      *    EXEC SQL INSERT INTO HU.TESTREPORT
      *      VALUES('0529','pass','MCO');
              ""               " be40 is java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
MOVE SQLCODE
             else
                 java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
      *    EXEC SQL INSERT INTO HU.TESTREPORT
      *      VALUES('0529','fail','MCO');
               CALL"USINGSQLCODEjava.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
                SQLCODESQL-COD
errcnt      *    ****  Procedures for PERFORM statements
             END-IF
      *  EXEC SQL COMMIT WORK;
 SUB7 SQLSTATE
MOVE TO QL-COD
             DISPLAY===================java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71

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

      *    ****  Procedures for PERFORM statements

      *Test SQLCODE and SQLSTATE for normal completion. 
       CHCKOK
             DISPLAY "java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
                                      VALUES('0529','fail','MCO');
             PERFORM NOSUBCLASSSQLCODE
             if (SQLCODE =  0                 errcnt java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
               MOVE 0 TO SQLCODE
             END-IF
             ifNORMSQ000"ANDNORMSQ NOT SQLSTATE)

               DISPLAY "Validjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
             END-IF      *    ****  Procedures for PERFORM statements
             .

       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

                 *subclasses with 000.  This replacement equates valid     
      *subclass begins in position 3 of char array NORMSQ 
      *valid subclass begins with 5-9, I-Z, end of ALPNUM table 
                             *                          SQLSTATE will be printed.                   MOVE TO 
java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
             PERFORM  FROM 1  norm2) 
           END-IF
END-PERFORMEND-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)            
           if (NORMSQ      *Changed NORMSQ means implementation-defined subclass,    
GO java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
           END-IF

           MOVE 4 TO norm1
mining  ofchararray java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 37
 0()
             norm2 1END-IF
java.lang.StringIndexOutOfBoundsException: Range [0, 11) out of bounds for length 10
             MOVE TO norm1
           PERFORnorm2 1  -A-Z

          
          norm1
      *            FROM1  UNTIL>36
      *examining position 5 of       implementation-defined           (orm2))then
            VARYINGE
           if (NORMSQX(norm1)      *implementation-defined s subclasses are allowedfor warnings
             MOVE "" TONORMSQXnorm1      SQLSTATEvaluesof000 
           END-IF
           END-PERFORM
   *SQLSTATE values 0java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
      *implementation-defined subclasses are.
      *(class = MOVE"E.
      *SQLSTATE values of 0000END-IF
      *Reference java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23

           if (NORMSQX(1)  =  "0"  AND  NORMSQX(2)  =  "1") then
             MOVE "0" TO NORMSQX(2)
           END-IF
           .

       EXIT-NOSUBCLASS.
           EXIT.

100%


¤ 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.5Bemerkung:  ¤

*Bot Zugriff






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.