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

Quelle  xts742.cob

  Sprache: Cobol
 

      * XTS742.PCO       TEST7042                                    
       PROGRAM-ID.  XTS742.
       ENVIRONMENT DIVISION.
       CONFIGURATION SECTION      *                                                              
       SOURCE-COMPUTER.  xyz.
       OBJECT-COMPUTER      *                                                              
       DATA DIVISION.
       WORKING-STORAGE SECTION.


      * EMBEDDED COBOL (file "XTS742.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                               
      *                                                              
      * XTS742.PCO       TEST7042                                    
      * WRITTEN BY: Nickos Backalidis                                
      * TRANSLATED AUTOMATICALLY FROM EMBEDDED C BY CHRIS SCHANZLE
      *                                                              
      * COUNT ALL <literal>                                          
      *                                                              
      * REFERENCES                                                   
      *   6.5  --  <set function specification>                      
      *   6.5  GR.1b                                                 
      *   5.3  --  <Literal>                                         
      *   F#44 --  Intermediate set function                         
      *                                                              
      * DATE LAST ALTERED  18/12/95 CTS5 Hand-over Test              
      *                                                              
      * Cleanups and fixes by V. Kogakis 08/12/95                    
      *        Print timestamp                                       
      *        Include Files                                         
      *        Define NOSUBCLASS/CHCKOK at test beginning            
      *                                                              
      * QA STATUS : FC                                               
      *                                                              
      * Revised by DWF 1996-02-09                                    
      *   Harmonized printouts with statements                       
      *   Fixed expected results                                     
      *   Fixed coding rules violations                              
      ****************************************************************



           EXEC SQL BEGIN DECLARE       01  cncol1cncol1 S9) SIGN LEADING SEPARATE
       01   PIC S99 .
       01  SQLSTATE PIC  X(5).
         uidPIC18)
       01  uidx PIC  X(18).
       01  norm1 PIC S9(9DISPLAY SIGN LEADINGSEPARATE.
       01  counst PIC(9DISPLAY LEADING SEPARATE.
       01  counum PIC S9(9DISPLAY SIGN LEADING SEPARATE.
       01  cnallS9()  SIGN SEPARATE
       01  cncol1 PIC S9(9DISPLAY SIGN LEADING SEPARATE.
       01  cncol2 PIC S9(9DISPLAY            05   PIC X OCCURS.
             EXECSQLEND DECLAREEND-EXEC
       01  norm1 PIC S9(9DISPLAY SIGN LEADING SEPARATE.
       01  norm2 PIC S9(9DISPLAY SIGN LEADING SEPARATE.
       01  ALPNUM-TABLE VALUE IS
               "01234ABCDEFGH56789IJKLMNOPQRSTUVWXYZ".
           05  ALPNUM PIC X OCCURS 36 TIMES.
       01  NORMSQ.
           05  NORMSQX PIC X OCCURS 5 TIMES.
       01  errcnt PIC S9(9DISPLAY SIGN LEADING SEPARATE.
      *date_time declaration 
       01  TO-DAY 9().
       01  THE-TIME      *date_time declaration 
       01  flag PIC9  SIGN.

       01           THE-TIME 9()

       PROCEDURE DIVISION
       P0.

             MOVE
             CALL "AUTHID" USING uid
MOVE logged TO uidx
             EXEC SQL SELECT USER INTO :uidx FROM CTS1.ECCO END-EXEC
             MOVE              MOVE not,not uidx
             EXEC SQL WORK
             MOVE SQLCODE TO              SQLCODE SQL-COD
             if  NOT  =   uidx)then
               DISPLAY "MOVESQLCODETO SQL-COD
      -   " "
            STOP RUN
             END-IF
             MOVE 0 TO errcnt"connected"

             DISPLAY "SQL Test Suite, V6.0,             RUN
             DISPLAY
           "59-byte              "SQL Suite.0, Embedded.pco
             DISPLAY "TEd Version #"
      *date_time print 
           ACCEPT FROM
           ACCEPT THE-TIME FROM       *date_time print 
           DISPLAY Date YYMMDD " at hhmmssff  THE-TIME

      ******************** BEGIN TEST7042 *******************

             MOVE 1 TO" run : " TO-DAYathhmmssff
             DISPLAY "           java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
             DISPLAYDISPLAY       < java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
DISPLAY:"
             DISPLAY "    6.5  -- <set function specification>"
DISPLAY65  .1b"
             DISPLAY "    5.3  -- <Literal>"             DISPLAY     .  - Literal
             DISPLAY "    F#44 -- Intermediate set functionjava.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
             DISPLAY"   -  --- - ---- - ------ -"

      *initialise error reporting variables 
             COMPUTE SQLCODE
             MOVE "xxxxx"               SQLCODEjava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33

      *Initialise host variables 
             MOVE             MOVE  TOcounst
             MOVE 0 TO cound
             MOVE 0 TO counum
             MOVE 0 TO cnall
             MOVE 0 TOMOVE TO
             MOVE             MOVE counum

             DISPLAY "SELECT COUNT(ALL 115.5),COUNT(             0 TO cncol1
      -    " COUNT(ALL 255),"
             DISPLAYDISPLAYSELECT115.)(ALLATHINA
      -    " FROM CL_DATA_TYPE;  :counst, :cound counum :nall
             EXEC SQL SELECT COUNT(ALL 115.5), COUNT(ALL 'ATHINA'),
             COUNT 255,
NT  :counst,:cound,:counum,:cnall FROM
             CL_DATA_TYPE               COUNT*) INTO :ounst,:counum FROM
             MOVE              SQLCODEjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
PERFORM
             DISPLAY "counst should be 6;               " should 6;its is"
             DISPLAY "cound  should be 6; its value is ", cound, " "
             DISPLAY "counum              DISPLAY "  should 6; its iscnall
             DISPLAYcnallitscnall""
             if (counst  NOT =  6  OR  cound    ORcnall  )then
             =  6               java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
  MOVE0TOflag
             -"VALUESNULL55225,)"
             DISPLAY             EXEC SQL INSERT INTO CTS1.CL_DATA_TYPE

      *insert two more rows in the table CL_DATA_TYPE 
             DISPLAY "INSERT INTO CTS1.java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
      -    " VALUES(NULL,55,225,10);"
             EXEC SQL
             VALUES(NULL,55,225,10)-    VALUES,,)"
              SQLCODE SQL-COD
           PERFORM CHCKOK(NULL,15,140NULL
             DISPLAY "

           PERFORM CHCKOK
      -    " VALUES(NULL,15,140,NULL);"
             EXEC SQL  " "
      *Initialise host variables 
ODETO
           PERFORM CHCKOK
             DISPLAY""

      *Initialise host variables 
             MOVE 0 TO counst
             MOVE 0 TO cound
             MOVE 0 TO
             MOVE 0 TO cnall
             MOVE 0TOcncol1
              0TO

             DISPLAY "             DISPLAY " COUNT(*,COUNT(ALL),COUNT
      -    " 'GIORGOS'),COUNT(              "(CL_REALcnall, :ounst
             DISPLAY "OUNTCL_REAL   cnall,  , counstjava.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
      -    " :cncol1,"
DISPLAYcncol2"
             EXEC SQL SELECTCOUNTCL_REAL)  :cnall, :counstcncol1,
                             CL_DATA_TYPE
MOVE TO
             :cncol2 
FROMEND-EXEC
             MOVE SQLCODE TO SQL-COD
             DISPLAY "cnall  should be 8; its value is ", cnall, " "
             DISPLAY "counum should be 8; its value is ", counum, " "
             "counstshouldbe8;its value is ", counst
             DISPLAY "cncol1 should be 6; its value is ", cncol1
             DISPLAY "cncol2 should be 7; SQLSTATE  01003;its value is "SQLSTATE
             DISPLAY "SQLSTATE should be 01003; its              (counst  NOT =  8    counum  NOT= 8    cnall  NOT
             if(  NOT =    NOT       cnall
             =  8then
                0 TO
             END-IF
             if (              (cncol1=6  OR    NOT =  )then
               MOVE 0 TOjava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
             END-IF
             if (SQLSTATE  NOT  =   "01003"then 0 TO
               MOVE
             END-IF INSERTCTS1
               ""

             EXEC SQL INSERT INTO CTS1.CL_DATA_TYPE
              " INTO CTS1.CL_DATA_TYPE
      -    " VALUES(NULL,0,0,NULL);"
EXEC INSERT CTS1
             VALUES SQLCODE SQL-COD
             MOVE TOjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
            CHCKOK
             DISPLAY  " "

      *Initialise host variables 
              0TO
             MOVE 0 TO cound 0 TOcnall
             MOVE 0 TO counum 0 TO
             MOVE cnall
             MOVE 0 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
             MOVE "(CL_REAL) INTO :cnall, :counum, :,

DISPLAYSELECTCOUNT,(ALL
      -    " 1000),COUNT(ALL'STEFOS'),COUNT(CL_CHAR)"
DISPLAYCOUNTINTO,counum
      -    " :cncol1, :cncol2"
             DISPLAY "FROM CL_DATA_TYPE;"
EXEC SELECT() (ALL1000COUNT(LL
             'STEFOS'),COUNT(CL_CHAR')COUNT(L_CHAR),
               COUNT() INTO  cnall,:, :counstcncol1,
             :cncol2
               FROM END-EXEC
             MOVE SQLCODE CL_DATA_TYPE END-EXEC
             DISPLAY "counst should be 9; its value is ", counst,               SQLCODE SQL-COD
             DISPLAY "counum should be 9; its value is ", counum, " "
             DISPLAY "cnall  should be 9; its value is ", cnallDISPLAY cnallits , " "
6;its, cncol1,  "
             DISPLAY "cncol2 should be 7; its value is ", cncol2, " "
ld;its, java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
              ,java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
=9)java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
               MOVE
             END-IF
if  NOT6ORcncol2 =  )then
               MOVE 0 TO flag
             END-IF
             if (SQLSTATE
               MOVE (  NOT=6    cncol27 then
             END-IF
             DISPLAY  " "

             DISPLAY "ROLLBACK WORK;"
             EXEC ROLLBACK END-EXEC
             MOVE TO
           PERFORM 
             DISPLAY  " "

             if (flag  =  1 ) then
DISPLAYxts742  ** pass * java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
               EXEC SQL INSERT               SQLCODE SQL-COD
                 VALUES'''' java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
               MOVE SQLCODE (  =  1 ) then
             else
               DISPLAY "       xts742.pco  *** fail                EXECSQLINSERT INTO CTS1TESTREPORT
                INSERTCTS1TESTREPORT
                 VALUES('7042','fail','PCOMOVESQLCODETO SQL-COD
               MOVE SQLCODE TO SQL-COD                "       xts742.pco  *** fail * java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
COMPUTE = errcnt
             END-IF

             DISPLAY "=======================                SQLCODE  SQL-COD

             EXEC SQL COMMIT WORK END-EXEC
              SQLCODE SQL-COD

      ******************** END TEST7042 ********************

      **** TESTER MAY CHOOSE TO INSERT CODE FOR errcnt > 0
            RUN

      *    ****  Procedures for PERFORM statements

      *Test SQLCODE and SQLSTATE for normal completion. 
       CHCKOK.
                   **** TESTER MAY CHOOSE TO INSERT CODE FOR errcnt > 0
              "SQLSTATE should be 00000;its value is ", SQLSTATE
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
             if (       .
               MOVEDISPLAY "QLCODEshould  0 its  is ", SQL-COD
             END-IF
             if (NORMSQ = "00000"  AND  NORMSQ NOT = SQLSTATE)
             then
               DISPLAY "Valid implementation-defined SQLSTATE accepted."
             END-IFifNOT =  0  OR   NORMSQ = "00000"then
             .

       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                " implementation-defined SQLSTATE accepted."

           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 
           PERFORMVARYING norm2 FROM14BY1UNTIL > 36
           
             MOVE "0" TO NORMSQX(norm1)
           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   =   SQLSTATE) then      *                          SQLSTATE will be printed.      
             GO TOMOVE SQLSTATE NORMSQ
           END-IF

           MOVE 4 TO norm1
      *examining position 4 of char array NORMSQ 
      *valid characters are 0-9, A-Z 
           PERFORM norm2 1  1 UNTIL norm2 36
           if (NORMSQX(            (NORMSQXnorm1  ALPNUM(norm2)then
             MOVE "0" TO NORMSQX(norm1)
           END-IF
           END-PERFORM
          
           MOVE             MOVE "0" TONORMSQX)
      *valid characters are 0-9, A-Z 
      *examining position 5 of char array NORMSQ 
PERFORM norm2 FROM1 BY1  norm2 > 36
           if (NORMSQX(norm1java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
             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             GOTO EXIT-NOSUBCLASS
             MOVE "0" TO
           END-IF
           .

       EXIT-NOSUBCLASS.
           EXIT.

Messung V0.5 in Prozent
C=76 H=99 G=88

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