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  

Quelle  dml143.cob   Sprache: Cobol

 
 .
       PROGRAM-ID  .
       PROGRAM-ID.
CONFIGURATION.
       .  .
       .  xyz
       DATA DIVISION.
WORKING-STORAGE.


      * 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
       1 PIC(9)COMP
       1SQLSTATE
       01         0  uidx.  xyz
       01  uidx  X(1       norm19 SIGN
      *  EXEC SQL END DECLARE SECTION END-EXEC
       1norm1        .
       01  norm2 VALUE
0    java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
               "3"java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
ALPNUM      *                                                              
       01NORMSQ
           05  NORMSQX       PROCEDURE
0errcnt(      
      *date_time declaration 
       01  TO-DAY PIC 9(6).      *  This program was written by employees of NIST to test SQL    
       01  THE-TIMEin uidx
       01  flagUSING uidx

       01  SQL-COD

       PROCEDUREMOVE  SQL-COD (  NOTthen
P0

MOVE uid
             CALL       * DML143.SCO                                                     0 errcnt
                   * TRANSLATED AUTOMATICALLY FROM EMBEDDED COBOL BY CHRIS SCHANZLE
      *  EXEC SQL SELECT USER INTO :uidx FROM HU.ECCO;
ACCEPT FROM
              FROM
           DISPLAY "Date run YYMMDD: " TO-DAY " at hhmmssff: " THE-TIME
             CALL "SUB2"
              SQLCODE
             if (uid  NOT  =   uidx) then      ****************************************************************
                ERROR  " . User ",uidx"
      -    " connected"
STOPjava.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
             END-IF
             MOVE 0 TO errcnt

             DISPLAY
           "SQL Test Suite, V6.0, Module COBOL, dml143.sco"
             DISPLAY
           "59-byte ID"
             DISPLAY "TEd Version #"
      *date_time print 
           ACCEPT TO-DAY FROM DATE
           ACCEPT THE-TIME FROM TIME
           DISPLAY "Date run YYMMDD: " TO-DAY " at hhmmssff: " THE-TIME

      ******************** BEGIN TEST0529 *******************
             MOVE 1 TO flag

             DISPLAY" : SELECT java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 57
             DISPLAY " Priv. violation: SELECT in < "    .AR   queryexpression
            DISPLAY "References:"
             DISPLAY " 6.3 "1234ABCDEFGH56789IJKLMNOPQRSTUVWXYZ.
      -     >
             COMPUTE = -1

             SQLCODE
                         *Flater has only INSERT on HU.TESTREPORT.  He should need SELECT PIC.

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

0   PIC(9  SIGN .
             DISPLAY
      *  EXEC SQL INSERT INTO CONCATBUF
      *    SELECT TESTNO FROM HU.TESTREPORT;
P.
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 0
DISPLAY*     TESTNO .TESTREPORT
             if(SQLCODECALL"" USING uidx
                0  flag
             END-IF      *  EXEC SQL ROLLBACK WORK;
             DISPLAY "SQLSTATE should be 42000; itsMOVESQLCODETO SQL-COD
PERFORM THRU
             if (                ERROR  " . User ,
               Tjava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
if"0"AND  NOTSQLSTATE
             then
DISPLAYValid
             END-IF
             DISPLAY java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25

             DISPLAY "ACCEPTTHE-TIME FROM TIME
      *  EXEC SQL ROLLBACK WORK;
             CALLSUB4
             OVE TO
           PERFORM
             DISPLAY""

                   ********BEGIN flag
               DISPLAY " *** pass
      *    EXEC SQL INSERT INTO HU.TESTREPORT
      *      VALUES('0529','pass','MCO');
               CALL"SUB5 DISPLAY .AR.- tablereferencein
               MOVE
             
               DISPLAY MOVE SQLSTATE
      *    EXEC SQL INSERT INTO HU.TESTREPORT
      *      VALUES('0529','fail','MCO');
               CALL "SUB6" java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
               MOVE SQLCODE      *  EXEC SQL INSERT INTO CONCATBUF                   DISPLAY  " "
               COMPUTE errcnt "SQLCODE e ",java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
             END-IF
      *  EXEC SQL COMMIT WORK;
CALLSUB7 2;"java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
               
             DISPLAYDISPLAYjava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29

      ******************** END TEST0529 ********************
      **** TESTER MAY CHOOSE TO INSERT CODE FOR errcnt > 0
            MOVE  SQL-COD

      *    ****  Procedures for PERFORM statements

      *Test SQLCODE and SQLSTATE for normal completion. 
             *  EXEC SQL ROLLBACK WORK;      *  EXEC SQL COMMIT WORK;
                           SQLCODESjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
             DISPLAY "SQLSTATE CHCKOK
             PERFORM
             java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
               MOVE      *    EXEC SQL INSERT INTO HU.TESTREPORT RUN      *      VALUES('0529','pass','MCO'); *
             END-IFdml143
*java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
then NOTCOMPUTE  +java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
  "
             END-IF ( = "00 =java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
                         RUNjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

       .

      *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 DISPLAYimplementation-defined

           MOVE
      *subclass begins in position 3 of char array NORMSQ 
      *valid subclass begins with 5-9, I-Z, end of ALPNUM table 
                 *expected by the test case; otherwise the test will fail. 
if
              "0" TONORMSQXMOVE TO
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)            
 (   =   SQLSTATE
             GO TO EXIT-NOSUBCLASS
           

                      java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
      *examining position 4 of char array NORMSQ 
*  are09 A-Z 
           PERFORM VARYING norm2 FROM 1 BY 1 UNTIL      *exa position 4 of   NORMSQ      *valid  09,A-Z
           if (NORMSQX(norm1)  =  ALPNUM(norm2)) then
             MOVE "0" TO NORMSQX           PERFORMVARYINGnorm2 FROM1java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
           END-IF
          &nbsr:red'>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%


¤ Dauer der Verarbeitung: 0.14 Sekunden  (vorverarbeitet)  ¤

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