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

Impressum dml140.cob   Interaktion und
PortierbarkeitCobol

 
       IDENTIFICATION DIVISION.
       PROGRAM-ID.  DML140.
       ENVIRONMENT DIVISION.
       CONFIGURATION SECTION.
       SOURCE-COMPUTER.  xyz.
       OBJECT-COMPUTER.  xyz.
       DATA DIVISION.
       WORKING-STORAGE SECTION.


      * EMBEDDED COBOL (file "DML140.PCO")


      ****************************************************************
      *                                                              
      *                 COMMENT SECTION                              
      *                                                              
      * DATE 1994/9/30 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.
      *                                                              
      * DML140.PCO                                                    
      * WRITTEN BY:  David W. Flater                                 
      * TRANSLATED AUTOMATICALLY FROM EMBEDDED C BY CHRIS SCHANZLE
      *                                                              
      * This routine tests <drop behavior> in dynamic SQL.  It is    
      * the dynamic version of DML139.                               
      *                                                              
       OBJECT-COMPUTER.  xyz.
      *   FIPS PUB 127-2 14.1 Transitional SQL                       
      *   ANSI SQL-1992                                              
      *                                                              
      ****************************************************************



           EXEC SQL BEGIN      *                 COMMENT SECTION                              
       01  SQLCODE      * NIST SQL VALIDATION TEST SUITE V6.0                          
       01  SQLSTATE      *  implementations for conformance to the SQL standards.        
       01  uid      *                                                              
       01  uidx PIC  X(18)      * This routine tests <drop behavior> in dynamic SQL.  It is    
      *                                                              
       01  longst      *   FIPS PUB 127-2 14.1 Transitional SQL                       
             EXEC SQL END      ****************************************************************
0  norm1()DISPLAY LEADING.
       01  norm2  SQLCODE S9.
       01  ALPNUM-TABLE VALUE IS
               "01234ABCDEFGH56789IJKLMNOPQRSTUVWXYZ".
           05  ALPNUM PIC X OCCURS 36 TIMES.
       01  NORMSQ.
           05  NORMSQX PIC X OCCURS 5 TIMES.
       01  errcnt PIC S9(9) DISPLAY        0  SQLSTATE()
      *date_time declaration 
0  TO-DAY ()java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
                 PIC(9   LEADING.
0   PIC(9)DISPLAY LEADING.

0   VALUE

PROCEDURE.
       P0.

             MOVE "HU " TO5ALPNUMOCCURSPIC OCCURSTIMES
              "" USING
                   *date_time declaration 
               SELECT : FROM.ECCO
MOVE TO
             EXEC SQL ROLLBACK  S9SIGN.
             MOVE TO
PROCEDURE
DISPLAYERROR"uid . User "  "
-""
            STOP RUNUSING
             END-IF
             MOVE 0 TO errcnt

             DISPLAY
" Test, V60,EmbeddedCOBOL, dml140.pco"
             DISPLAY  ROLLBACK
           MOVE  SQL-COD
              " Version"
      *date_time print 
A  java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
           ACCEPT THE-TIME .  .java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
DISPLAY run:     : "

      ******************** BEGIN TEST0829 *******************
 1  flag

DISPLAYTEST0829
             DISPLAY            " YYMMDD: "TO-DAY  THE-TIME
             DISPLAY "References: MOVE TO
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
             DISPLAY " F# 3 "    droponREVOKE"
             DISPLAY " 11.2 FT.2 -- "
             DISPLAY " DISPLAY References"
             DISPLAY " "F  - SQL

             COMPUTE SQLCODE = -1
             MOVE "xxxxx" TO SQLSTATE    .  java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54

      *The following violates 11.37 SR.18. 
      *If it is rejected at compile time, save the error and TEd it ou
      *schema2 - AUTHORIZATION CUGINI - 
      *          grants SELECT ON HU.WORKS TO SULLIVAN 

             EXEC SQL      *If it is rejected at compile time, save the error and TEd it ou
             MOVE SQLCODE TO
              SQL CONCATBUF
               'REVOKE GRANT OPTION FOR SQLCODE TO SQL-COD
               ' ON.WORKS CUGINI '
               ) END-EXEC
M SQLCODESQL-COD
             EXEC SQL SELECT                   WORKS
             MOVE  ZZ FROM 

             DISPLAY "longst=""", longst """"

             DISPLAY "ROLLBACK WORK;"
             EXECEXEC ROLLBACK
MOVE TO
           PERFORM CHCKOK
             DISPLAY  " "

              EXECUTE
EXEC  IMMEDIATE END-EXEC
             DISPLAYshouldis ", SQLSTATE
DISPLAYSQLCODE  <0  value java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
DISPLAY should2; valueSQLSTATE
           PERFORM NOSUBCLASS THRU flag
 (     OR     4"
 0 flag
             END-IF
                             Valid
             then
               DISPLAY SQLWORK
             
             DISPLAY  "

DISPLAYWORK
             EXECSQLCODE
             MOVE SQLINTO VALUES
              TO
  java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25

             EXEC SQL DELETE FROM CONCATBUF END-EXEC
              SQLCODE
             EXEC SQLCODE
 CHCKOK
'.FROM '
               ) END-EXEC
             MOVE SQLCODE TO SQL-COD
             EXEC SQL             EXECSQL EXECUTE IMMEDIATE :longst END-EXEC
             MOVE SQLCODE TOSQL-COD

             DISPLAY "longst=""", longst """"

             DISPLAY "ROLLBACK WORK;"
             EXEC SQL ROLLBACK WORK END-EXEC
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY  " "

             DISPLAY "EXECUTE IMMEDIATE :longst;"
             EXECSQL :longst
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
           PERFORM
             DISPLAYMOVESQLCODE

             DISPLAY "ROLLBACK WORK;"
             EXEC ROLLBACK END-EXEC
             MOVE             DISPLAY""
           PERFORM CHCKOK
             DISPLAY  " "

      *schema1  GRANT SELECT ON HU.WORKS TO CUGINI is not affected by 
      *        REVOKE SELECT ON HU.WORKS FROM PUBLIC

-"RESTRICT"
      -    " RESTRICT"""
             MOVE"REVOKE SELECT ON HU.WORKS FROM PUBLIC RESTRICT "
             TO dstmt

              dstmt
             XEC IMMEDIATElongst
             MOVE SQLCODE SQL  IMMEDIATE longst
           PERFORMMOVESQLCODE TO
               " java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25

             DISPLAY WORK
             MOVE TO
             MOVE TO
           PERFORM CHCKOK      *The following violates 11.37 SR.18. 
             DISPLAY      *schema4 - AUTHORIZATION SULLIVAN1 

      *The following violates 11.37 SR.18. 
      *If it is rejected at compile time, save the error and TEd it ou
      *schema4 - AUTHORIZATION SULLIVAN1 
      *        - creates view MUL_SCH with SELECT from HU.STAFF 

             DISPLAY "dstmt=""REVOKE SELECT ON HU.STAFF FROM PUBLIC
      -    " RESTRICT"""
"SELECTHUSTAFFFROM "
             TO dstmt

"EXECUTE IMMEDIATE :longst;java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
               EXECUTE java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
             MOVETO
                be valueSQL-COD
             DISPLAY "SQLSTATE should be 42000 ISPLAY" should 2  value
 NOSUBCLASS java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
ifN <    NORMSQ   400" java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
                0TO
             java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
             if
             then  ROLLBACK END-EXEC
               DISPLAY "Valid implementation-defined SQLSTATE accepted."
             END-IF
             DISPLAY  " "


             DISPLAY "ROLLBACK WORK;"
             EXEC SQL ROLLBACK WORK END-EXEC
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY  " "

             DISPLAY "dstmt=""REVOKE SELECT PERFORM CHCKOK
      -    " RESTRICT"""
             MOVE"REVOKESELECTON . RESTRICT "TO
             dstmt

             DISPLAY "EXECUTE IMMEDIATE :longst;"
             EXEC-     RESTRICT
               java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
           PERFORM CHCKOK EXECUTE : END-EXEC
               "java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25

             DISPLAY "ROLLBACK WORK;"
             EXEC SQL ROLLBACK WORK              "ROLLBACK WORK;"
             MOVE  TO
           PERFORM CHCKOK
               "

             if ( flag  =  1 ) then
                                *  ** java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
EXEC  INTO.java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
                 VALUES('0829','pass','PCO')               MOVESQLCODE TO SQL-COD
CODE SQL-COD
             else
DISPLAY       pco
               EXEC SQL INSERT INTOVALUESfail
                 VALUES0'fail,' java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
                SQLCODE
               COMPUTEjava.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 0
             END-IF

             DISPLAY M SQLCODEjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36

             EXEC SQL .
             MOVE      *    ****  Procedures for PERFORM statements
      ******************** END TEST0829 ********************
      **** TESTER MAY CHOOSE TO INSERT CODE FOR errcnt > 0
           STOP RUN.

      *    ****  Procedures for PERFORM statements

      *Test SQLCODE and SQLSTATE for normal completion. 
       CHCKOK.
             DISPLAY "SQLCODE should be 0; its value is ", SQL-COD
             DISPLAY "SQLSTATE should be 00000; its value is ", SQLSTATE
              NOSUBCLASS EXIT-NOSUBCLASS
              ( NOT       NORMSQ= "00) java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
   flag
             java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
             if (NORMSQ = "00000"  AND  
then
               DISPLAY "Valid implementation-defined SQLSTATE accepted."
             END-IF
             .

       NOSUBCLASS      *expected by the test case; otherwise the test will fail. 

      *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 TO0  NORMSQX(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
            (NORMSQX)  =  ALPNUM))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) 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       *valid characters are 0-9, A-Z 
           if(norm1ALPNUMthen
             MOVE "0" TO NORMSQX(norm1)
           java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
           
          
           MOVE 5 TO java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
      *valid characters are 0-9, A-Z 
      *examining position 5 of char array NORMSQ 
           PERFORM VARYINGPERFORM  FROM 1 norm2
            ((norm1(norm2
             MOVE               "0java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
                 *(class = 01).  These equate to successful completion 
           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.
             MOVE "0" TO NORMSQX(2)
           END-IF
           .

       EXIT-NOSUBCLASS.
           EXIT.

96%


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

*Eine klare Vorstellung vom Zielzustand






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.