Eine aufbereitete Darstellung der Quelle

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

Benutzer

Quelle  yts813.cob   Sprache: Cobol

 

       DIVISION
       PROGRAM-ID.
       ENVIRONMENT
       CONFIGURATIONSECTION
       SOURCE-COMPUTER  java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
       OBJECT-COMPUTER.  xyz.
       DATA DIVISION.
      *This program was reviewed by employees of NIST for            


      * EMBEDDED COBOL (file "YTS813.PCO")


      *Copyright 1996 National Computing Centre Ltd, 
      *and Computer Logic R&D S.A 
      *on behalf of CTS5 SQL2 Project. 
      *All rights reserved.                                          
      *The CTS5 SQL2 Project is sponsored by the European Community. 
      *                                                             
      *The National Computing Centre Limited and Computer Logic R&D  
      *have given permission to NIST to distribute this program      
      *over the World Wide Web in order to promote SQL standards.    
      *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.                                                 


      ****************************************************************
      *                                                              
      *                 COMMENT SECTION                              
      *                                                              
      * SQL VALIDATION TEST SUITE V6.0                               
      *                                                              
      * YTS813.PCO                                                   
      * WRITTEN BY:  Susan Watters                                   
      * TRANSLATED AUTOMATICALLY FROM EMBEDDED C BY CHRIS SCHANZLE
      *                                                              
      * This routine tests <null predicate> with                     
      * (numeric value expression> in <row value constructor>        
      *                                                              
      *                                                              
      * REFERENCES                                                   
      *   8.6 GR2   <null predicate> - IS NULL                       
      *   8.6 GR3   <null predicate> - IS NOT NULL                   
      *   6.12 GR1  <numeric value expression>                       
      *   6.2 GR7   <value specification> and <target specification> 
      *   13.5 GR2b <select statement : single row>                  
      *   F#48      Expanded null predicate                          
      *                                                              
      * DATE LAST ALTERED 02.01.96 CTS5 Hand-over Test               
      *                                                              
      * QA Status: Full FC                                           
      *                                                              
      * Revised by DWF 1996-04-03                                    
      *   Added rollback after authid                                
      *   Removed EXEC SQL from printfs                              
      *   Renamed variable                                           
      *   Fixed expected results                                     
      ****************************************************************



           EXEC SQL
       01  SQLCODE PICS99 .
       01  SQLSTATE       01   PIC (9)COMP
01val1PICS94  SIGN LEADING.
       01  indic1 PIC S9(4)         val1 PIC S9) DISPLAY SIGN LEADING SEPARATE.
       01  uid PIC  X(18).
       01  uidx PIC  X(18).
             EXEC SQL END DECLARE SECTION01 (4DISPLAY java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
        9 java.lang.StringIndexOutOfBoundsException: Range [57, 56) out of bounds for length 57
       01  norm2 PIC        01  ALPNUM-TABLE
       01  ALPNUM-TABLE VALUE IS
               "01234ABCDEFGH56789IJKLMNOPQRSTUVWXYZ"             ALPNUMPICXOCCURS36TIMES
           05  ALPNUM PIC X OCCURS 36 TIMES.
       01  NORMSQ.
           05  NORMSQX PIC X OCCURS 5 TIMES.
       01  errcnt PIC S9(9) DISPLAY SIGN LEADING SEPARATE.
      *date_time declaration 
       01  TO-DAY PIC 9(6).
       01  THE-TIME PIC 9(8).
       01  flag PIC S9(9) DISPLAY SIGN LEADING SEPARATE.

       01  SQL-COD PIC S9(9) DISPLAY SIGN LEADING SEPARATE.

       PROCEDURE DIVISION.
       P0.

             MOVE "CTS1              " TO uid
             CALL "AUTHID" USING uid
             MOVE "not logged in, not" TO uidx
             EXEC SQL SELECT USER INTO :uidx FROM CTS1.ECCO END-EXEC
             MOVE SQLCODE TO SQL-COD
             EXEC SQL ROLLBACK 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, yts813.pco"
             DISPLAY
           "59byte ID"
             DISPLAY "TEd Version #"
      *date_time print 
TO-DAY FROMjava.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
         .
           DISPLAY "Date run YYMMDD       DIVISION.

      ******************** BEGIN TEST7570 *******************
              WORKING-STORAGESECTIONjava.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31

             DISPLAY "                        *All rights reserved.                                          
             DISPLAY "   <      *The National Computing Centre      *over the World Wide Web in order to promote SQL standards.    
      -          *This program was reviewed by employees of NIST for            
             DISPLAY "References:      *NIST assumes no responsibility for any party's use of         
             DISPLAY "    8.6 GR2   <null predicate> - IS 
      *                                                              
             DISPLAY "    6.12 GR1  <numeric value expression>"
             DISPLAY "    6.2 GR7   <value specification> and"
             DISPLAY "              <target specification>"
             DISPLAY "    13.5 GR2b <      * YTS813.PCO                                                   
             DISPLAY "    F#48 Expanded null predicate"
             DISPLAY "   - -       * This routine tests <null predicate> with                     

             COMPUTE SQLCODE      *                                                              
             MOVE "xxxxx" TO SQLSTATE

      *Prepare database for test 

             DISPLAY "INSERT       *   6.2 GR7   <value specification> and <target specification>       *   13.5 GR2b <select statement : single row>                  
      -    " EMP_HOURS)"
             DISPLAY      * DATE LAST ALTERED 02.01.96 CTS5 Hand-over Test               
             EXEC SQL INSERT INTO CTS1.PROJ_DURATION      * QA Status: Full FC                                           
               VALUES (1,      * Revised by DWF 1996-04-03                                    
             MOVE SQLCODE       *   Renamed variable                                           
           PERFORM CHCKOK
               " "

             DISPLAY "INSERT INTO CTS1.PROJ_DURATION  (,,4;"
             EXEC SQL INSERT INTO CTS1.PROJ_DURATION VALUES (2,3,4)
             END-EXEC
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY  ""

             DISPLAY "INSERT INTO CTS1.PROJ_DURATION (MONTHS,
      -    " TIME_LEFT)"
             DISPLAY "VALUES (3,5);"
             EXEC         indic1 PICS9() DISPLAYSIGNLEADINGSEPARATEjava.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
               VALUES (3, 5) END-EXEC
             MOVESQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY  ""

             05  ALPNUM XOCCURS36 java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
            EXEC  INSERTINTO . VALUES (4 ,7java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
             END-EXEC
             MOVE SQLCODE TO SQL-COD
                 *date_time declaration 
             DISPLAY  ""

      *count rows where TIME_LEFT + EMP_HOURS is not NULL 

      *initialise host variable 
             MOVE 99 TO01flag S99   LEADING SEPARATE.

             java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
             " CTS1.ROJ_DURATION"
             CALLAUTHID  uid
             EXECSQL COUNT()INTO:java.lang.StringIndexOutOfBoundsException: Range [49, 50) out of bounds for length 49
               CTS1PROJ_DURATION
               WHERE TIME_LEFT + EMP_HOURS IS NOT NULL  MOVE   SQL-COD
             MOVESQLCODE TOSQL-COD
           PERFORM              SQLCODETOSQL-COD
              "alue  , .0 Embedded COBOL,yts813.co"
             if (val1  NOT =  2) then
                0 flag
             END-IF

      *declare a cursor to return MONTHS when TIME_LEFT- EMP_HOURS is 

             DISPLAY "DECLARE            " run:"TO-DAY   hhmmssff:"THE-TIME
             DISPLAY                TOflag
              "                  java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
             DISPLAY "ORDER BY MONTHS;"
             EXEC SQL DECLARE data813       -    consjava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
                            DISPLAY86GR2<predicate  NULL
WHERE-TIME_LEFTISNULL
               ORDER BYDISPLAY     .12 GR1< value>java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63

             DISPLAY "OPEN data813;"
             EXEC SQL              "   13. GR2b<statement   row"
             MOVE SQLCODE TO SQL-COD
PERFORMjava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
             DISPLAY  ""

      *fetch all rows defined by cursor 

      *initialise host variables 

             MOVE 99 TO val1

             DISPLAY "java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 24
             EXEC SQL FETCH             EXEC INSERTINTO CTS1.PROJ_DURATION (MONTHS, EMP_HOURS)
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY "alue 1 expected ,val1, "returnedjava.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
             if (val1  NOT =  1)            CHCKOK
               MOVE
             END-IF

      *initialise host variables 

             MOVE 99 TO val1

             DISPLAY "java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
             EXEC              DISPLAY INTOCTS1P Mjava.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
             MOVE SQLCODE TO SQL-COD
           java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
              "value expected," val1, returned"
             if (val1               MOVE SQLCODE 
               MOVE0TOflag
             END-IF

             DISPLAY "FETCH                 CTS1. VALUES (4, 6, 7)
             EXEC SQL FETCH data813END-EXEC
             MOVE SQLCODE TO 

      *That should generate a no data exception 
      *which is SQLSTATE 02000 

             DISPLAY "SQLCODE should 
             ifMOVE TO 
               MOVEDISPLAY " COUNT ()INTO val1"
             
              WHERETIME_LEFT+EMP_HOURSISNOTNULL"
           PERFORM NOSUBCLASS THRU java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
             if (               FROM .
               MOVE 0  flag
             END-IF
             if (NORMSQ   =   "02000             MOVE SQLCODETO SQL-COD
             then
               DISPLAY "Valid implementation-defined SQLSTATE accepted."
             END-IF
             DISPLAY  " "

      *execute update statement 

      *put negative value into null indicator 

             DISPLAY             END-IF
             COMPUTE indic1 = -99

      *put random value into host variable 

             DISPLAY "val1 =  data813  FOR"
             MOVE 34 TO val1

             DISPLAY "UPDATE               " EMP_HOURS  TIME_LEFT IS"
             DISPLAY " TIME_LEFT =9"
             DISPLAY "WHERE EMP_HOURS * :val1 java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 48
      -    " NULL;"
             EXEC SQL UPDATE CTS1.               SELECT MONTHS  CTS1.ROJ_DURATION
               SET TIME_LEFT = 9
                :indic1 ISNOT
             END-EXEC
             MOVE SQLCODE TOSQL-COD

                           OPENdata813"
             if (SQLCODE  NOT =  100) then
               MOVE 0 TO flagPERFORM java.lang.StringIndexOutOfBoundsException: Range [25, 26) out of bounds for length 25
             
             DISPLAY "SQLSTATE
           PERFORM  THRU
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
MOVE TOflag
             END-IF
             if(      "2000    NOT=SQLSTATE)
             then
               " implementation-defined SQLSTATE accepted.java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
             END-IF
             DISPLAY  " "

      *check no rows have been updated 

             MOVE 99 TO val1
             DISPLAY "SELECT java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
             DISPLAY "FROM CTS1.PROJ_DURATION"
             DISPLAY"TIME_LEFT = 9;"
             EXEC SELECT ()INTO :val1
               MOVE SQLCODESQL-COD
               WHERETIME_LEFT=9 END-EXEC
             MOVE SQLCODE TO              DISPLAY "value 3 expect" val1,"returned
           PERFORM CHCKOK
             DISPLAY "value java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 19
             if (val1  NOT =  0)                 data813 INTO :val1END-EXEC
               MOVEjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
             END-IF

      *execute an update statement where indic1 is positive 

      *initialise host variables 

             java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
 "val1 = 99;"
             MOVE 9 TO indic1
             MOVE 99 TO val1

             DISPLAY "UPDATE CTS1.PROJ_DURATION "
             DISPLAY"SET EMP_HOURS =3"
             DISPLAY "WHERE EMP_HOURS * :val1 INDICATOR :indic1 IS NOT
      -    " NULL;"
             EXEC SQL UPDATE CTS1.              (   =  02000  AND  NORMSQNOT    )
               SET EMP_HOURS = 3 
               WHERE EMP_HOURS * :val1 INDICATOR :indic1 IS NOT NULL
             END-EXEC
              DISPLAY  ""
           PERFORM CHCKOK
             DISPLAY  " "

      *check relevent rows have been updated 

             MOVE 99 java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 0
             DISPLAY "SELECT COUNT (*) INTO java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
              F CTS1.ROJ_DURATIONjava.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
             DISPLAY "WHERE EMP_HOURS = 3;"
             EXECDISPLAY" CTS1."
                .
               WHERE EMP_HOURS = 3 END-EXEC              "WHERE *: INDICATOR :indic1  NOT
             MOVE              EXEC SQL UPD .
           PERFORM CHCKOK
DISPLAY value expectedis 3, returned is" val1
             if (val1  NOT =  3) then
               MOVE 0 TO flag
             END-IF

      *check row containing null value in EMP_HOURS has not been updat

      *initialise host variables 

             MOVEDISPLAY"QLSTATE be ; its value  " 
             MOVE 99 TO val1

             DISPLAY"SELECT EMP_HOURS INTO :val1:indic1"
             DISPLAY "FROM CTS1.PROJ_DURATION"
             DISPLAY "WHERE MONTHS = 3;"

                          EXEC
ROJ_DURATION
               WHERE MONTHS = 3 END-EXEC
             MOVE  TOSQL-COD
            CHCKOK
             DISPLAY "indic1 should be 1 itsvalue " indic1
             if (indic1  NOT
               MOVE 0 TO flag
             END-IF

      *ensure database is left in a consistent state 

             DISPLAY "ROLLBACK WORK"
             SQLWORK
             MOVE SQLCODE              MOVE SQLCODE TO ()INTO :val1
           PERFORM CHCKOK
             DISPLAY  " "

             if ( flag  =  1 ) then
               DISPLAY "       yts813.pco  *** pass *** "
               EXEC SQL INSERT INTO CTS1.TESTREPORT
                 VALUES('7570','pass'                0TOjava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
               MOVE SQLCODE TO SQL-COD
             else
               DISPLAY "       yts813.pco                "  ;
               EXEC INSERTINTO .
                 VALUES(7570,'ail,')END-EXEC
               MOVE SQLCODE TO SQL-COD
               COMPUTE errcnt = errcnt + 1
             END-IF

             DISPLAY "================      -    NULL;java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19

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


      **** TESTER MAY CHOOSE TO INSERT CODE FOR errcnt > 0
                        DI  ""

      *    ****  Procedures for PERFORM statements

      *Test SQLCODE and SQLSTATE for normal completion. 
       CHCKOK.
             DISPLAY"   java.lang.StringIndexOutOfBoundsException: Range [53, 52) out of bounds for length 66
SQLSTATE ;  is 
             PERFORM NOSUBCLASS THRU EXIT-NOSUBCLASS
             if (SQLCODESQLCODETO
               MOVE 0 TO flag
             END-IF
D  NORMSQ =java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
             
               DISPLAY "java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 19
             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.      

           SQLSTATE NORMSQ

MOVE  norm1
      *subclass begins in position 3 of char array NORMSQ 
      *valid subclass begins with 5-9, I-Z, end of ALPNUM table 
           PERFORM VARYINGnorm2FROM14BY1norm2>36
)=ALPNUM(norm2) then
             MOVE "0" TO NORMSQX                0TOflag
           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             DISPLAY  " "
             GO TO EXIT-NOSUBCLASS
              (   =1 )then

           MOVE 4 TO norm1
      *examining position 4 of char array NORMSQ 
      *valid characters are 0-9, A-Z 
           PERFORM VARYING               MOVE  TOSQL-COD
            (NORMSQX(orm1  = ALPNUM(norm2))then
              ""TO (orm1
           END-IF
           END-PERFORM
          
           MOVE 5 TO norm1
      *valid characters are 0-9, A-Z 
      *examining position 5 of char array NORMSQ 
           VARYING FROM1BY norm2 >36
           if (NORMSQX               COMMIT END-EXEC
             MOVE "0" TO NORMSQX(norm1)
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
           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 (NORMSQX(1)  =  "0"  AND  NORMSQX(2)  =  "1") then
             MOVE "0" TO PERFORMNOSUBCLASS  EXIT-NOSUBCLASS
           END-IF
           .

       EXIT-NOSUBCLASS.
           EXIT.

Messung V0.5 in Prozent
C=94 H=94 G=93

¤ Dauer der Verarbeitung: 0.7 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.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

letze Version des Elbe Quellennavigators


Jenseits des Üblichen ....

Besucher

Besucher

Statistik
#Sources=1127926
#Domains=2039723