Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 


Quelle  dml137.cob   Sprache: Cobol

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


      * EMBEDDED COBOL (file "DML137.PCO")


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



           java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
       01     *                                                              
       01  SQLSTATE PIC      * WRITTEN BY:  David W. Flater                                 
       0     *                                                              
       0      *                                                              
             EXEC      * REFERENCES                                                   
       01  norm1 PIC S9(      *   ANSI SQL-1992                                              
       01  norm2 PIC S9(9) DISPLAY SIGN      ****************************************************************
       0   VALUEjava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
"3ABCDEFGH56789IJKLMNOPQRSTUVWXYZ".
           05  ALPNUM1uid  X18)java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
       01  NORMSQ1  uidx  X(18)
           05  NORMSQXEXECEND DECLARE END-EXEC
              1   PIC(9) DISPLAY SIGN LEADING SEPARATE.
      *date_time declaration 
       1  TO-DAY (6)java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
       01   PIC 9(8).
                      "01234ABCDEFGH56789IJKLMNOPQRSTUVWXYZ"".

       01       0NORMSQ05   PIC X OCCURSTIMES

       PROCEDUREDIVISION
       P0.

             OVEFLATERTO
             CALL "AUTHID" USING1  THE-TIME PIC(8)
             MOVEnot innotTO
             java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
             MOVE TO SQL-COD
             EXEC SQL WORK END-EXEC
             MOVE SQLCODE TO SQL-COD
             if (uid  NOT  =   uidx) then
               DISPLAY "ERROR: User ", uid " expected. User ", uidx "
      -    " connected"
            STOP RUN
             END-IF
             MOVE 0 TO errcnt

             DISPLAY
           "SQL Test Suite, V6.0, Embedded COBOL, dml137.pco"
             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 TEST0697 *******************
             MOVE 1 TO flagP0

             DISPLAY "TEST0697 "
             DISPLAY "Erratum: drop behavior, constraints (static)"
             DISPLAY "References:"
             DISPLAY " COR2 11 CALL"" USING uid
      -                  "not loggedin, not" TOjava.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
             DISPLAY" F 3--Basic "
             DISPLAY " 11.2 FT.2 -- "
             DISPLAY " 11.18 -- "
              SQLCODE SQL-COD

             COMPUTE SQLCODE = -1
             OVE"TO SQLSTATE

             DISPLAY "CREATE TABLE UNDROPPABLE ("
             DISPLAY " C1 INT PRIMARY KEY NOT NULL);"
             EXEC if(uid  =   uidxthen
               C1 INT PRIMARY KEY NOTDISPLAYERRORUser uid expected,uidx
                     SQLCODE SQL-COD
           PERFORMCHCKOK
             DISPLAY  " "

             DISPLAYEND-IF
             EXEC SQLCOMMIT END-EXEC
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
           RM
             DISPLAY  " "

             DISPLAY "CREATE TABLE DROPPABLE ("
             DISPLAY " C1 INT PRIMARY KEY NOT NULL REFERENCES
      -    " UNDROPPABLE,"
             DISPLAY " C2 INT "5-byte"
             DISPLAY"TEdVersion #"
               C1 INT PRIMARYACCEPT TO-DAY DATE
               ACCEPT THE-TIME TIME
             MOVESQLCODE SQL-COD
           PERFORMjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
             DISPLAY" "

             java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 0
             EXEC SQLDISPLAY ": drop behavior, constraints (static)"
             OVE TO SQL-COD
           PERFORMCHCKOK
             DISPLAY             RESTRICTed             DISPLAY" # 3- Basic manipulationjava.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60

      *The following violates 11.18 SR.4 since the view WCOV exists. 
      *If it is rejected at compile time, save the error and TEd it ou

             DISPLAY java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
             EXEC SQL  MOVExxxxx SQLSTATE
             MOVE "CREATE TABLE UNDROPPABLE ("
                          DISPLAY" NOT NULL)"
             DISPLAY "SQLSTATE should be 42000; its value is ", SQLSTATE
           PERFORM NOSUBCLASS THRU EXIT-NOSUBCLASS
             if(SQLCODENOT <0OR  NOT  =  400") then
               MOVE 0 TO flag
             END-IF
              SQLCODETO
             then
               DISPLAY " implementation-defined SQLSTATE."
             END-IF
             DISPLAY  " "

             DISPLAY" WORK;"
             java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
             MOVE TO SQL-COD
           PERFORM 
             DISPLAY  " "

      *The following violates 11.18 SR.4 since DROPPABLE has a referen
      *constraint defined on UNDROPPABLE.                             
      *If it is rejected at compile time, save the error and TEd it ou

             DISPLAY "EXECSQL TABLE DROPPABLE (
             EXEC SQLDROP UNDROPPABLERESTRICT END-EXEC
             MOVE SQLCODE TO
                          OVE TO java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
             MOVE TO
                      PERFORM CHCKOK
             if (SQLCODE  NOT <0  ORN  NOT  =   "42000")then
 flag
             END-IF
             if (NORMSQ   =   "42000"  AND  NORMSQ  NOT  =   SQLSTATE      *If it is rejected at compile time, save the error and TEd it ou
             then
               DISPLAY "alid implementation-defined "
             END-IF
             DISPLAY  " "

             DISPLAY "COMMIT WORK;"
             EXEC SQL COMMIT WORK END-EXEC
             MOVE SQLCODE TO SQL-COD
           ERFORM
             DISPLAY  " "

      *The following is affected by the erratum.  It should succeed. 

             DISPLAY "DROP TABLE DROPPABLE RESTRICT;"
             EXECDISPLAYSQLSTATEbe20; itsis, SQLSTATE
             MOVE SQLCODEPERFORM NOSUBCLASS THRU
           PERFORM CHCKOK
             DISPLAY" "

             DISPLAY                0 TO
             EXEC SQL COMMITif(NORMSQ"200"  AND  NORMSQ  NOT  =   )
             MOVE SQLCODEDISPLAY"Valid implementation-defined accepted
                        END-IF
             DISPLAY  " "

      *The following is affected by the erratum.  It should succeed. 
      *Referential constraint from DROPPABLE is gone now.            

             DISPLAY "DROP
             EXEC SQL DROP TABLE UNDROPPABLE RESTRICT END-EXEC
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY  " "

             DISPLAY "COMMIT WORK;"
             EXEC      *constraint defined on UNDROPPABLE.                             
             MOVE SQLCODE TO SQL-COD
           ERFORM
             DISPLAY  " "


             if ( flag             OVE TO SQL-COD
               DISPLAY " *** pass *** "
                 INSERT HU
                 VALUES " should be 4200; itsvalue is ", SQLSTATE
               MOVESQLCODE SQL-COD
             else
               DISPLAY " dml137.pco *** fail ***
               EXEC SQL INSERTif(NORMSQ"400 AND NORMSQ NOT = SQLSTATE)
                 VALUES('097''fail',''END-EXEC
               MOVESQLCODE SQL-COD
               COMPUTE errcntEND-IF
             END-IFDISPLAY""

             java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

             EXEC SQLMOVE SQLCODE java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
             MOVE TO SQL-COD
      ******************** END TEST0697 ********************
      **** TESTER MAY CHOOSE TO INSERT CODE FOR errcnt > 0
            RUN.

      *    ****  Procedures for PERFORM statements

      *Test SQLCODE and SQLSTATE for normal completion. 
       .
             DISPLAY "SQLCODE should be 0; java.lang.StringIndexOutOfBoundsException: Range [0, 46) out of bounds for length 36
             java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
EXEC SQL COMMIT END-EXEC
             if ( NOT =0ORNORMSQ = "0000" java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
               MOVETO flag
             END-IF
             if (NORMSQ = java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
             then
               DISPLAY "Valid implementation-definedjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
             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             DISPLAY" "

           MOVE 3 TO              EXEC SQL COMMIT WORK END-EXEC
      *subclass begins in position 3 of char array NORMSQ 
      *valid subclass begins with 5-9, I-Z, end of ALPNUM table 
           PERFORM ARYING FROM 14 BY 1UNTIL > 36
           if (NORMSQX(norm1)  =  ALPNUM CHCKOK
             MOVE "0" TO NORMSQX(norm1             DISPLAY    =  1 ) then
                         INSERT INTO.TESTREPORT
           
           
      *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)            
           ifDISPLAYdml137fail
              TOjava.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
           END-IF

           MOVE 4 TO norm1
      *examining position 4 of char array NORMSQ 
      *valid characters are 0-9, A-Z 
           PERFORM VARYINGCOMPUTEerrcnt + 1
            (NORMSQXnorm1)  =  ALPNUM(norm2) 
             MOVE "0" TO
java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 17
           ND-PERFORM
          
           MOVE 5 TO norm1
      *valid characters are 0-9, A-Z 
      *examining position 5 of char array NORMSQ 
           PERFORM VARYING norm2      **** TESTER MAY CHOOSE TO INSERT CODE FOR errcnt > 0
           if (NORMSQX(norm1  =ALPNUM)) then
             MOVE "0
           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 

(1  =""  AND()= "") java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
             MOVE "0" TO NORMSQX(             ERFORM THRUEXIT-NOSUBCLASS
           END-IF
           .

       EXIT-NOSUBCLASSMOVE TO flag
           EXIT

Messung V0.5
C=92 H=99 G=95

¤ Dauer der Verarbeitung: 0.6 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 und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Produkte
     Quellcodebibliothek

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge