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

Quellcode-Bibliothek xts728.cob   Sprache: Cobol

 
        .
       ..
        DIVISION
       CONFIGURATION..
.  .
       .  .
       DATA
       WORKING-STORAGE SECTION.


      * Standard COBOL (file "XTS728.SCO") calling SQL
      * procedures in file "XTS728.MCO".


      *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                               
      *                                                              
      * XTS728.SCO                                                   
      * WRITTEN BY: Nickos Backalidis                                
      * TRANSLATED AUTOMATICALLY FROM EMBEDDED COBOL BY CHRIS SCHANZLE
      *                                                              
      *  Flagging Full SQL - <null predicate> with two-col row       
      *                                                              
      * REFERENCES                                                   
      *   8.6  -- <null predicate>                                   
      *   7.1  -- <row value constructor>                            
      *   7.1 LR.1a -- Intermediate SQL restriction which prohibits  
      *                the use of more than one <row value           
      *                constructor element> in a <row value          
      *                constructor> that is not simply contained in  
      *                a <table value constructor>                   
      *   F#37 -- Intermediate SQL Flagging.                         
      *                                                              
      * DATE LAST ALTERED  12/12/95 CTS5 Hand-over Test              
      *                                                              
      * Cleanups and fixes by V. Kogakis 04/12/95                    
      *                                                              
      * QA Status: QA Check                                          
      *                                                              
      * Revised by DWF 1996-02-01                                    
      *   Fixed char string lengths                                  
      *   Deleted extraneous reference to 7.1 SR.1                   
      *   Removed CHCKOK after no data delete                        
      ****************************************************************



      * EXEC SQL BEGIN DECLARE SECTION END-EXEC
       01  SQLCODE PIC S9(      *                a <table value constructor>                   
       01  SQLSTATE PIC      *                                                              
       01  uid PIC  X(18).
       01  uidx PIC  X(18).
       01  c_ch1 PIC  X(10).
       01  c_ch2 PIC  X(10).
      *  EXEC SQL END DECLARE SECTION END-EXEC
       01  norm1      *                                                              
       01  norm2 PIC S9(9) DISPLAY SIGN      *   Deleted extraneous reference to 7.1 SR.1                   
       java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
"13ABCDEFGH56789IJKLMNOPQRSTUVWXYZ"
           01c_ch1  X(1).
       0       1  c_ch2 PIC  X(10).
           05  NORMSQX PIC X OCCURS 5 TIMES.
       01  errcnt PIC S9(9) DISPLAY SIGN LEADING SEPARATE.
      *date_time declaration 
       01  TO-DAY PIC        1norm2 S9 DISPLAYSIGN SEPARATE
       1   PIC 9(8).
01  flag DISPLAYSIGN.

       01  SQL-COD PIC S9(9) DISPLAY SIGN LEADING           5ALPNUM X  36 TIMES

       PROCEDURE DIVISION.
       P0.

       1   PIC S99 SIGN SEPARATE
             CALL "AUTHID" USING   PIC 9(6).
MOVEnotinnot  uidx
      *  EXEC SQL SELECT USER INTO :uidx FROM CTS1.ECCO;
             CALL "SUB1" USING SQLSTATE uidx
             MOVE SQLCODE
      *  EXEC SQL ROLLBACK WORK;
              "SUB2"USING SQLSTATE
             MOVE SQLCODE
             f(  NOT  =   uidx
               DISPLAYP.
-" "
            STOP RUN
             END-IF
              "AUTHID" USING

             DISPLAY "SQL Test Suite, V6.0, Module COBOL, xts728.sco"
             DISPLAY
"9-yte "
             DISPLAYTEd
      *date_time print 
           ACCEPT TO-DAY java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
            THE-TIMETIME
           DISPLAY "Date run YYMMDD: " TO-DAY " at hhmmssff

      ******************** BEGIN TEST7028 *******************
             MOVE 1 TO flag
             DISPLAY " TEST7028"
             DISPLAY " Flagging,Full SQL, with
      -    " two-col row"
             DISPLAY " References "
             DISPLAY " 8 DISPLAY"ERRORUser uid expected  User ", uidx, "
             DISPLAY " 7.1 --
                   -     connected
      -    " MOVE0TOjava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
DISPLAYthe use more one row
      -    " constructor"
             DISPLAY " element> in a
      -    " 5-byteID"
              " simplycontained in < value
      -    " constructor>"
             DISPLAYACCEPT FROM java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
DISPLAY       -   ----       "

      *Initialise error reporting variables 
             COMPUTE SQLCODE =java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
             MOVE" SQLSTATE

      *use tables TABLE728a and TABLE728b from the standard schema 
      *Make sure that table728b is empty 
  FROM.TABLE728b"
      *  EXEC SQL DELETE FROM CTS1.TABLE728b;
             CALL "SUB3" USING               " References "
             MOVE SQLCODE " 7. -< value constructor>"

      *execute the following query 
      *if a syntax error does not occur then all the 
      *columns of TABLE728a that are not NULL *
      *will be copied in TABLE728b 
             DISPLAY-"constructor"
             DISPLAY "SELECT * FROM CTS1.TABLE728a"
DISPLAY "WHERE(,C2) IS NOTNULL;"
      *  EXEC SQL INSERT INTO CTS1.TABLE728b
      *    SELECT * FROM CTS1.TABLE728a
      *    WHERE (C1,C2) IS NOT NULL;
             DISPLAY--             -
                           SQLCODE 1
           PERFORMMOVE"" TO
             DISPLAY  " "

      *initialise host variables 
             MOVE      *  EXEC SQL DELETE FROM CTS1.TABLE728b;
             MOVE  c_ch2

      *Use two select statement(s):single row and examine the 
      *contents of table CTS1.728b 
      *1st select 
             DISPLAY      *if a syntax error does not occur then all the 
             DISPLAY      *will be copied in TABLE728b 
              " * FROM CTS1TABLE728a
      *  EXEC SQL SELECT COL_1,COL_2 INTO :c_ch1,:c_ch2
      *    FROM CTS1.TABLE728b
      *    WHERE COL_1 = 'NICKOS' AND COL_2 = 'GEORGE';
             CALL              "" USING SQLSTATE
             MOVE CHCKOK
           PERFORM
             DISPLAY      *contents of table CTS1.728b 
             DISPLAY" should be GEORGE its value is ",c_ch2
             if (c_ch1               DISPLAY" CTS1.TABLE728b
java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
MOVE flag
             END-IF
             DISPLAY  ""

      *initialise host variables 
             MOVE "xxxxxxxxxx" TO c_ch1
             MOVE "xxxxxxxxxx" TO c_ch2

      *2nd SELECT  
  c_ch1
             DISPLAY "FROM DISPLAY" should GEORGE value 
             DISPLAY" COL_1 = 'HARRY' AND COL_2 ='';"
      *  EXEC SQL SELECT COL_1,COL_2 INTO :c_ch1,:c_ch2
      *    FROM CTS1.TABLE728b
      *    WHERE COL_1 = 'HARRY' AND COL_2 = 'TANIA';
             CALL "SUB6" USING
             MOVEjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
           PERFORM CHCKOK "" TO
      *2nd SELECT  
             " ;itsvalueis"cjava.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
             if " COL_1 = 'HARRY'ANDCOL_2='';"
             then
                     *    WHERE COL_1 = 'HARRY' AND COL_2 = 'TANIA';
             END-IF
             DISPLAY  " "

             DISPLAY "ROLLBACKWORK"
      *  EXEC SQL ROLLBACK WORK;
             CALL "SUB7" USING
SQLCODE
              c_ch1   HARRY  NOT   TANIA
             DISPLAY"

      *record results 

if  =  1java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
      *  EXEC SQL ROLLBACK WORK;
      *    EXEC SQL INSERT INTO CTS1.TESTREPORT
      *      VALUES('7028','pass','MCO');
                ""USING
               MOVE TO
DISPLAYSQL
               java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
               DISPLAY" successfully."
                " xts728. *** pass** "
      -    " WARNING"
             else
               DISPLAY " xts728.**NOGO * java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
      *    EXEC SQL INSERT INTO CTS1.TESTREPORT
      *      VALUES('7028','NOGO','MCO');
               CALLDISPLAY<p>with
               MOVE SQLCODE " must demonstrate IntermediateFlagger
               DISPLAY "Vendor does not else
               DISPLAY "Intermediate SQL extension "
               DISPLAY                " .mco ***NOGO** java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
     "
             
             DISPLAY "======== " SQL "

      *  EXEC SQL COMMIT WORK;
             CALL "SUB10" USING
MOVEjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
      ******************** END TEST7028 ********************

      **** TESTER MAY CHOOSE TO INSERT CODE FOR errcnt > 0
           STOP.

      *    ****  Procedures for PERFORM statements

      *Test SQLCODE and SQLSTATE for normal completion. 
       .
             DISPLAY "SQLCODE should be 0; its value
             DISPLAY       *Test SQLCODE and SQLSTATE for normal completion. 
PERFORM THRU
             if (SQLCODE SQLSTATE0; value
               PERFORM THRU
             END-IF
             if (NORMSQ = "00000"  AND  NORMSQ NOT = SQLSTATE)
             then
               DISPLAYValid
             END-IF
java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14

      .

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

            SQLSTATEjava.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34

           MOVE 3 TO             VARYING FROM  1UNTIL  6
      *subclass begins in position 3 of char array NORMSQ 
      *valid subclass begins with 5-9, I-Z, end of ALPNUM table 
           PERFORM norm2 1  1UNTIL  3java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
           if (NORMSQX
             MOVE "0"      *Changed NORMSQ means implementation-defined subclass,    
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   =   SQLSTATE
             GO TO EXIT-NOSUBCLASS
           END-IF

           MOVE "0 TO NORMSQXnorm1)
      *examining position 4 of char array NORMSQ 
      *valid characters are 0-9, A-Z 
           PERFORM  FROM1 1  norm26
           if (NORMSQX(norm1)  =  ALPNUM(norm2)) then
             MOVE "0" TO      *examining position 5 of char array NORMSQ 
END-IF
           END-PERFORM
          
           MOVE 5 TO            if (NORMSQX(nor)  = ALPNUM)) 
      *valid characters are 0-9, A-Z 
      *examining position 5 of char array NORMSQ 
           PERFORM            java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
           java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
             MOVE "0" TO NORMSQX(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 

           if (NORMSQX(1)  =  "0"  AND  NORMSQX(2)  =  "1"then
             MOVE "0" TO NORMSQX(2)
           END-IF
           .

       EXIT-NOSUBCLASS.
           EXIT.

99%


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

*Bot Zugriff






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.