Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Cobol/Test-Suite/SQL P/xts/   (NIST Cobol Test-Suite ©)  Datei vom 4.1.2008 mit Größe 25 kB image not shown  

Quelle  xts725.cob   Sprache: Cobol

 

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


      * EMBEDDED COBOL (file "XTS725.PCO")


      *Copyright 1995 National Computing Centre Limited               
      *and Computer Logic R&D S.A                                     
      *on behalf of the 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                               
      *                                                              
      * XTS725.PCO                                                   
      * WRITTEN BY: Nickos Backalidis                                
      * TRANSLATED AUTOMATICALLY FROM EMBEDDED C BY CHRIS SCHANZLE
      *                                                              
      * Flagging, Full SQL INSENSITIVE cursor                        
      *                                                              
      * REFERENCES                                                   
      *   13.1    -- <declare cursor>                                
      *   13.2    -- <open statement>                                
      *   13.3    -- GR.3.e.i                                        
      *   F#79    -- Insensitive cursors                             
      *   F#37    -- Intermediate SQL Flagging                       
      *                                                              
      * DATE LAST ALTERED  14/12/95 CTS5 Hand-over Test              
      *                                                              
      * Cleanups and fixes by V. Kogakis 04/12/95:                   
      *      Change in the values of rows inserted in the table      
      *                                                              
      * QA Status: QA check                                          
      *                                                              
      * Revised by DWF 1/30/96                                       
      *   Removed status checks after cursor definition              
      *   Fixed char string lengths                                  
      ****************************************************************



           EXEC SQL BEGIN DECLARE SECTION END-EXEC
       01  SQLCODE PIC S9(9) COMP.
       01 SQLSTATEPIC  X(5).
01  uid PICX18)
       01  uidxPICX(18)
              CONFIGURATION SECTION.
       01  c_num2 PIC S9(9) DISPLAY SIGN LEADING SEPARATE.
       01  c_ch1 PIC  X(10).
       01  c_ch2 PIC  X(10).
             EXEC SQL END DECLARE SECTION END-EXEC
       01  norm1 PIC S9(9) DISPLAY SIGN LEADING SEPARATE.
        PIC () DISPLAY  LEADING SEPARATE.
       01 ALPNUM-TABLE 
               "01234java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 21
           05  ALPNUM PIC X OCCURS 36       *on behalf of the CTS5 SQL2 Project.                            
             *The CTS5 SQL2 Project is sponsored by the European Community. 
           05  NORMSQX PIC X OCCURS 5 TIMES.
             *The National Computing Centre Limited and Computer Logic R&D  
      *date_time declaration 
       01  TO-DAY      *over the World Wide Web in order to promote SQL standards.    
       01  THE-TIME PIC 9(8).
       01  flag PIC S9(9) DISPLAY SIGN LEADING      *conformance to the SQL standards.                             

             ****************************************************************

       PROCEDURE DIVISION.
       P0.

             MOVE "CTS1              " TO uid
             CALL "AUTHID" USING uid
      * SQL VALIDATION TEST SUITE V6.0                               
             EXEC SQL SELECT USER INTO :uidx FROM CTS1.      * XTS725.PCO                                                   
             MOVE SQLCODE TO      *                                                              
             EXEC SQL ROLLBACK WORK END-EXEC
             MOVE SQLCODE TO      * REFERENCES                                                   
             if (uid  NOT      *   13.2    -- <open statement>                                
               DISPLAY "      *   F#37    -- Intermediate SQL Flagging                       
      -    "       *                                                              
            STOP RUN
             END-IF
                   *                                                              

             DISPLAY       *                                                              
             DISPLAY
           "59-byte ID"
             DISPLAY "TEd       *   Fixed char string lengths                                  
      *date_time print 
           ACCEPT  FROM DATE
           ACCEPTTHE-TIME TIME
           DISPLAY "Date run YYMMDD: "  01SQLSTATE  X(5.

      ******************** BEGIN TEST7025 *******************
             MOVE 1 TOjava.lang.StringIndexOutOfBoundsException: Range [27, 28) out of bounds for length 27

             DISPLAY "                        01  c_num2 PIC S9(9) DISPLAY SIGN LEADING
             DISPLAY "    Flagging           X10.
             DISPLAY "References"
             DISPLAY "    13.1    -- <declare cursor> "
                          EXEC END SECTION END-EXEC
             DISPLAY     13. 3e. java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
             "F79--  cursors"
             DISPLAY "    F#37    -- Intermediate SQL Flagging "
             DISPLAY "   - - - - - - - -                "01234".

      *Initialise error reporting variables 
             COMPUTE SQLCODE = -1
             MOVE "xxxxx" TO SQLSTATE

      *Use standard schema table CTS1.CL_STANDARD        
      *declare an insensitive cursor based on columns of 
      *CTS1.CL_STANDARD                                  
              "DECLARECLCURS INSENSITIVE CURSOR"
             DISPLAY "FOR SELECT COL_NUM1,COL_CH1,COL_NUM2,java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 29
             FROMCL_STANDARD
             DISPLAY "ORDER BY COL_NUM1 EADING .
EXEC DECLARECLCURS  CURSOR
               FOR SELECT COL_NUM1,java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
               java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
               ORDER BY COL_NUM1 DESC END-EXEC

             DISPLAY "OPEN CLCURS;"
             EXEC SQL OPEN              not logged,notTO
MOVE SQLCODETO SQL-COD
           PERFORM CHCKOK
             MOVE  TO 

      *NOW insert a row in CL_STANDARD  
                          MOVE SQLCODE  
           VALUES1005'',,')"
                            DISPLAY "RROR:User ,uid,"expected.User" ,"
VALUES,KEVIN,005'' 
             MOVE SQLCODE TO SQL-COD
            CHCKOK
             DISPLAY  " "

      *initialise host variables 
            MOVE "xxxxxxxxxx" TO c_ch1
             MOVE "xxxxxxxxxx" TO c_ch2
             MOVE 0 TO c_num1
             MOVE 0 TO c_num2

      *use a select <statement: single row> and determine 
      *that the row was inserted and is visible           
             DISPLAY "      *date_time print 
"INTO :_num1, :c_ch1,:, :_ch2 java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
            DISPLAY FCL_STANDARDWHERECOL_NUM1=1005;java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
EXECSQL  COL_NUM1,OL_CH1COL_NUM2,COL_CH2 
               INTO :c_num1, :c_ch1
               FROM CL_STANDARD WHERE             MOVE  TO flag
java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 36
           PERFORM                Flagging - SQLINSENSITIVEjava.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
            "  be ;   it is :" 
             DISPLAY              "   13.2    -<open statement>"
             DISPLAY "COL_NUM2 should be 4005;   it is : ", c_num2
DISPLAY"  java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 65
             if (c_num1DISPLAY--- -------   --- ----
      *Initialise error reporting variables 
               0TOflag
             END-IFMOVE""  SQLSTATE
             if (c_ch2  NOT  =   "XIOS
               MOVE 0 TO flag
                   *CTS1.CL_STANDARD                                  
DISPLAY""

      *re-initialise host variables 
             MOVE "xxxxxxxxxx" TO c_ch1
             MOVE xxxxxxxxxx TOc_ch2
             MOVE 0 TO c_num1
             MOVE 0 TO c_num2

      *now start fetching rows from CL_STANDARD 
             DISPLAY F   :c_num1,:_,:_,
      -    " :c_ch2;"
             EXEC    INTO:_,:,:c_num2, :_h2
             END-EXEC
             MOVE                CL_STANDARD
           PERFORM CHCKOK
      *since the cursor is declared insensitive with cursor  
      *specification ORDER BY DESC the last row will be      
      *returned first however if the inserted row is visible 
      *through the cursor then record a NOGO                 
             PERFORM 
              DISPLAY  "java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
             DISPLAY"should be 4004 itis " c_num2, ""
             DISPLAY "COL_CH2  should          " 1005''4005'XIOS';
      *check if the inserted row is visible through           
      *the cursor proceed if not record a NOGO if it is       
             if (c_num1  NOT =  1004  OR  c_ch1  NOT  =   "MORRIS"  OR 
                        CHCKOK
MOVE0TOflag
             END-IF
             if (c_ch2  NOT  =                 ""TO
               MOVE 0 TO               TOc_num1
             END-IF
             java.lang.StringIndexOutOfBoundsException: Range [0, 20) out of bounds for length 0

      *re-initialise host variables 
MOVE" 
             MOVE "xxxxxxxxxx" TO c_ch2
            0 c_num1
             MOVE 0 TO c_num2

      *fetch second row 
             DISPLAY "FETCH CLCURS INTO :             EXEC SQL SELECT COL_NUM1,COL_CH1,COL_CH2 
      INTOc, c_ch1 c_num2,c_ch2
URS :,:_,: c_ch2
             END-EXEC
             MOVE              SQLCODE  SQL-COD
           PERFORM CHCKOK
              be 1003;itis " c_num1, " "
             DISPLAY "COL_CH1  should be GEORGE; it is ", c_ch1, "  "
             DISPLAY"COL_NUM2 should be 4003;   it is ", c_num2, " "
             DISPLAY "COL_CH2  should be ARTA;   it is ", c_ch2, " "
             if(c_num1  NOT=1003  OR c_ch1  NOT=   "EORGE"   
             c_num2  NOT              C  shouldbeXIOS   is:,c_ch2
               MOVE 0 TO flag
             END-IF
             if (_ch2NOT    ARTA)then
               MOVE 0 TO flag
             END-IF
             DISPLAY  " "

      *re-initialise host variables 
             MOVE "xxxxxxxxxx" TO c_ch1
             MOVE "xxxxxxxxxx" TO c_ch2
             MOVE 0 TO c_num1
             MOVE 0 TO c_num2

      *fetch third row 
             DISPLAY "FETCH CLCURS INTO :c_num1, :c_ch1, :c_num2,
      -    " :c_ch2;"
             EXEC SQL FETCH CLCURS INTO :c_num1, :c_ch1, :c_num2, :c_ch2
             END-EXEC
             MOVE SQLCODE TO SQL-COD
           PERFORM 
             DISPLAY "COL_NUM1 should be 1002;  it is " c_num1, " "
             DISPLAY "COL_CH1  should be MAKIS;  it is ", c_ch1, "  "
              "COL_NUM2  be ;   it is " c_num2,""
             DISPLAY "COL_CH2               DISPLAY  ""
             if (c_num1  NOT =              "" TO c_ch1
             c_num2  NOT =  4002) then              0TOc_num1
               java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 0
             END-IF
             if (c_ch2  NOT  =   "HANIA" ) then
               MOVE 0 TO flag
                         
             DISPLAY               

      *re-initialise host variables 
              xxxxxxxxxx TOc_ch1
             MOVE "      *since the cursor is declared insensitive with cursor  
             MOVE 0 TO c_num1
             MOVE 0 TO c_num2

      *fetch fourth row 
              :c_num1, :c_ch1 :_um2
      -    " :c_ch2;"
             EXEC AY "COL_CH1 should be MORRISit is " c_ch1, "  "
             END-EXEC
MOVE TOjava.lang.StringIndexOutOfBoundsException: Range [36, 37) out of bounds for length 36
           PERFORM CHCKOK      *check if the inserted row is visible through           
 should 1001;is"c_num1  java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
DISPLAY"should be ; it is " c_ch1 "  "
             DISPLAY "COL_NUM2 should be                 0TO 
              COL_CH2 RHODES  " ,""
             if (c_num1  NOT =               MOVE0java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
             c_num2  
               MOVE  "  

             if (c_ch2  NOT              0 
               MOVE 0 TO                MOVE 0 TO flag
             END-IF
               java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25

      *re-initialise host variables 
             MOVE "OL_NUM1   1003    is " c_num1  java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
             "  
             MOVE 0 TO c_num1
             MOVE 0 TO c_num2

      *fetch fifth row 
             DISPLAY "DISPLAY "OL_CH2 be;it" ,  "
      -     if(  NOT=1003        ""OR
             EXEC SQL FETCH CLCURS INTO :c_num1, :c_ch1, :c_num2, :c_ch2
             END-EXEC
             MOVE SQLCODE TO SQL-COD
CKOK
             java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
             MOVE 0
            DISPLAYC  4000   it ,c_num2  java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  =        N"OR
             c_num2  NOT =  4000 java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
               MOVE      *fetch third row 
             END-IF
             if (c_ch2  NOT  =   "ATHENS") then
                            EXEC SQL FETCH   :_num1,:_h1,:c_num2 :c_ch2
             END-IF
DISPLAY  ""

      *end fetches 
      *close the cursor and open it again. If the vendor      
      *supports the extension then the inserted row should be 
      *now visible through the cursor                         

             DISPLAY "CLOSE CLCURS;"
             EXEC             "should be 4002;itis " , "
 TO
           PERFORM CHCKOK
             DISPLAY   "

      *open the cursor again 
             DISPLAY "               MOVE 0  flag
             EXEC SQL OPEN CLCURS END-EXEC
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY  " "

      *now fetch and check if the inserted row is visible 
      *initialise host variables 
             MOVE "xxxxxxxxxx" TO c_ch1
             MOVE "xxxxxxxxxx             DISPLAY  "   " "
             MOVE 0 TO c_num1
             MOVE 0 TO c_num2

             DISPLAY "FETCH CLCURS INTO :c_num1, :c_ch1, :c_num2,
      -    " :c_ch2;"
             EXEC SQL FETCH CLCURS INTO :c_num1, :c_ch1, :c_num2,               c_num2
             END-EXEC
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
      *since the cursor is declared insensitive with cursor  
      *specification ORDER BY DESC the last row will be      
      *returned first 
             DISPLAY "OL_NUM1  be 1005   it  ", _num1  
             DISPLAY            CHCKOK
            COL_NUM2  be;it  ,java.lang.StringIndexOutOfBoundsException: Range [65, 64) out of bounds for length 69
             DISPLAYCOL_NUM24001   is ,java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
      *check if the inserted row is visible through the cursor
      *proceed if not record a NOGO if it is                  
ifc   =1005    ="   
             c_num2  NOT =  4005) then
               0 TO
             END-IF
ifc_ch2   ="")then
               MOVE 0 TO flag
             END-IF
             DISPLAY   java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25

      *fetch remaining 5 rows, initialising before the host variables 
             MOVE "xxxxxxxxxx" TO c_ch1
                          "      *re-initialise host variables 
             MOVE 0              java.lang.StringIndexOutOfBoundsException: Range [31, 29) out of bounds for length 39
MOVE0  c_num2
             DISPLAY "FETCH       *fetch fifth row 
      -":;"
             EXEC SQL FETCH CLCURS INTO :c_num1,                FETCH CLCURS INTO:_,:, c_num2, :c_ch2
             END-EXEC
             MOVE SQLCODE TO  PERFORMCHCKOK
           PERFORM CHCKOK
             DISPLAY "COL_NUM1 should be 1004;  it is ", c_num1, " "
             DISPLAY "COL_CH1               DISPLAY "COL_CH1  shouldbeNICKOS; t is", c_ch1, "  "
             DISPLAY "COL_NUM2 should be 4004;  it              DISPLAY "COL_NUM2 should be 4000;   it is," "
             "    PARGA;it is" c_ch2  "
              =       =""java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
                            MOVE   flag
               MOVE 0 TO flag
END-IF
             if (c_ch2                0TOflag
               MOVE 0 TO flag
             END-IF
             DISPLAY  " "

      *4 remaining 
             MOVE "xxxxxxxxxx" TO c_ch1
             MOVE "xxxxxxxxxx" TO c_ch2
                          DISPLAYCLOSE"
             MOVE 0 TO              EXEC SQL CLOSE C END-EXEC
             DISPLAY "FETCH CLCURS INTO :c_num1, :c_ch1, :c_num2,
      -    "             
             EXEC SQL FETCH CLCURS INTO :c_num1,java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
             END-EXEC
             MOVE SQLCODE  SQL-COD
           PERFORM                TO SQL-COD
                   *since the cursor is declared insensitive with cursor  
                   *returned first 
              should  4003   is " , java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
             DISPLAY"should ARTA;itis "  "java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
             if(  NOT=1003    c_ch1       "EORGE" OR
             c_num2  NOT =  4003)              DISPLAY "COL_CH2  should it" 
               MOVE 0 TO ifcNOT         "KEVIN  java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
             END-IF
             if (c_ch2  NOT  =   "ARTA") then
               MOVE 0 TO flag
java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
             DISPLAY  " "

      *3 remaining 
             MOVE "xxxxxxxxxx" TO c_ch1
             MOVE "xxxxxxxxxx" TO c_ch2
             MOVE 0 TO c_num1
MOVE 0TO 
             DISPLAY "FETCH CLCURS INTO :c_num1, 
      -    " :c_ch2;"
             EXEC SQL FETCH CLCURS INTO :c_num1, 
             END-EXEC
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY "COL_NUM1 should be 1002;   it is ", c_num1, " "
             DISPLAY "COL_CH1            CHCKOK
             DISPLAY "COL_NUM2 should be 4002;   it is ", c_num2, " "
                          "COL_CH2  should be ;itis ,c_ch2, "java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
             if (c_num1  NOT =  1002  OR  c_ch1  NOT  =   "MAKIS"  OR 
             c_num2  NOT =  4002)  if(_um1NOT =  1004      NOT  =  MORRIS"   
               MOVE 0 TO flag
             
             if (c_ch2  NOT  =   "HANIA")             
               MOVE 0 TO flag
             
             DISPLAY  " "

      *2 remaining 
             MOVE "xxxxxxxxxx" TO c_ch1
             MOVE "xxxxxxxxxx" TO c_ch2
             MOVE 0 TO              MOVE"xxxxxxxxxx" TO c_ch1
             MOVE 0 TO c_num2
DISPLAY"FETCH CLCURS  :c_num1, :,:,
      -    " :c_ch2;"
              SQLFETCHCLCURSINTO:, :_ch1 :,:
             END-EXEC
             SQL-COD
           PERFORM CHCKOK
             DISPLAY "COL_NUM1 should be 1001;   it is ", c_num1, "              DISPLAY"FETCH CLCURSINTO:c_num1, :c_ch1, :c_num2,
             DISPLAY"COL_CH1  should be MARIA;  itis,c_ch1,   java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
             DISPLAY "COL_NUM2 should be 4001;   it is ", c_num2, " "
             DISPLAY "COL_CH2  should be RHODES; it is ", c_ch2           PERFORM CHCKOK
             if              "COL_NUM1  be  1003   it  " c_num1, java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
             c_num2  NOT =  4001) then
               DISPLAYjava.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 69
             END-IF
             if (c_ch2  NOT  =   "RHODES")              if (c_ch2  NOT  =   "RHODES") then
               MOVE 0 TO 
             END-IF
             DISPLAY  " "

      *1 remaining 
MOVE"  c_ch1
             MOVE "xxxxxxxxxx" TO c_ch2
MOVE c_num1
             MOVE 0 TO c_num2
             DISPLAY "FETCH CLCURS              MOVE""TO 
      -    " :c_ch2;"
             EXEC SQL FETCH CLCURS INTO :c_num1, :             EXEC SQL FETCH CLCURS INTO :c_num1, :c_ch1
             END-EXEC
             MOVE SQLCODETOjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
           PERFORM CHCKOK
             DISPLAY "COL_NUM1 should be 1000;   it is "              SQLCODE  
DISPLAY C  shouldbeNICKOSit", c_ch1   "
             DISPLAY "COL_NUM2               "   be ;    ,c_ch1  java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
             DISPLAY "COL_CH2  should be ATHENS  it is              (_   =1002OR    NOT  =  "   
if(NOT=1000ORc_ch1     ""OR
             c_num2  NOT =  4000) then
               MOVE 0 TO flag
             END-IF
             if (c_ch2               if (c_ch2  NOT)then
               MOVE 0 TOflag
             END-IF
             DISPLAY  " "

      *end fetches 
      *now close the cursor 
             DISPLAY "CLOSE CLCURS;"
             EXEC SQL CLOSE CLCURS END-EXEC
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY  "java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25

      *restore table CL_STANDARD in its original state 
             DISPLAY "ROLLBACK WORK;END-EXEC
              WORKjava.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
SQLCODE SQL-COD
           PERFORM CHCKOK
             DISPLAY   "

      *record results 

             if ( flag  =  1 ) then
               DISPLAY "               SPLAY "COL_CH2should be; it " c_ch2  "
                SQL INTO .ESTREPORT
                 VALUES('7025',             NOT =4001) then
               MOVE SQLCODE TO SQL-COD
               java.lang.StringIndexOutOfBoundsException: Range [0, 22) out of bounds for length 19
-    " successfully
               DISPLAY 0
-     "
             else
               DISPLAY "       xts725.pcojava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
               EXEC SQL INSERT             "xxxxxxxxx"TOc_ch2
                 VALUES('7025','NOGO','PCO'              0 
MOVETOjava.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
               DISPLAY "Vendor does not support              EXEC SQL FETCH CLCURS INTO :c_num1, :c_ch1 c_ch2
               DISPLAY"Intermediate SQL extension "
               DISPLAY "           PERFORM 
             

DISPLAY======================="

      *BAK : Check again in order to insert a third option for fail 
      *DWF: ??? 

             EXEC SQL COMMIT WORK END-EXEC
MOVE TOSQL-COD

      ******************** END TEST7025 ********************

      **** 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; java.lang.StringIndexOutOfBoundsException: Range [0, 46) out of bounds for length 25
             DISPLAY "SQLSTATE should be 00000             ose the cursor 
             PERFORM NOSUBCLASS THRU EXIT-NOSUBCLASS
             if (SQLCODE NOT =  0  OR   java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 36
               MOVE 0 TO flag
             END-IF
             if (NORMSQ = "00000"  AND  NORMSQ NOT = SQLSTATE)
             then
               DISPLAY "Valid implementation-defined SQLSTATE accepted."
             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 SQLSTATE TO NORMSQ

           MOVE 3 TO norm1
      *subclass begins in position 3 of char array NORMSQ 
      *valid subclass begins with 5-9, I-Z, end of ALPNUM table 
             norm2 FROM  BY 1UNTIL >36
           if (NORMSQX(norm1)  =  ALPNUM(norm2)) java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 21
             MOVE "0" TO NORMSQX(norm1)
           END-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      =  SQLSTATE) 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      *DWF: ??? 
           if              SQL  WORKEND-EXEC
             MOVE "0" TO NORMSQX(norm1)
           END-IF
           END-PERFORM
          
           MOVE 5 TO norm1
      *valid characters are 0-9, A-Z 
      *examining position 5 of char array NORMSQ 
           PERFORM VARYING norm2 FROM 1 BY 1 UNTIL 
           if (NORMSQX(norm1)       .
             (norm1)
           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  =0"AND     ")then
             MOVE "0" TO NORMSQX(2)
           END-IF
           .

       EXIT-NOSUBCLASS.
           EXIT.

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

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