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

Quelle  yts790.cob   Sprache: Cobol

 

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


      * EMBEDDED COBOL (file "YTS790.PCO")


      *Copyright 1996 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                               
      *                                                              
      * YTS790.PCO                                                   
      * WRITTEN BY:  Susan Watters                                   
      * TRANSLATED AUTOMATICALLY FROM EMBEDDED C BY CHRIS SCHANZLE
      *                                                              
      * GRANT USAGE on character set, WITH GRANT OPTION              
      *                                                              
      *                                                              
      * REFERENCES                                                   
      *   11.28   <character set definition>                         
      *   11.36   <grant statement>                                  
      *   10.3    <privileges>                                       
      *   11.3    <table definition>                                 
      *   11.4    <column definition>                                
      *   16.4    <set session authorization identifier statement>   
      *   F#45    Character set definition                           
      *   F#25    Domain definition                                  
      *   F#32    User authorisation                                 
      *   F#3     Basic schema manipulation                          
      *   F#2     Basic information schema                           
      *                                                              
      * DATE LAST ALTERED 02.01.96 CTS5 Hand-over Test               
      *                                                              
      * QA Status: Full FC                                           
      *                                                              
      * Revised by DWF 1996-03-22                                    
      *   Added rollback after authid                                
      *   Removed extraneous code                                    
      ****************************************************************


           java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 0
       01nformance to thesponsibility for any      *this program.                                                 
       01  SQLSTATE PIC  X(5).
       01  uid PIC  X(18).
       01  uidx PIC  X(18).
                   * YTS790.PCO                                                   
       01  norm1 PIC S9(9) DISPLAY       * GRANT USAGE on character set, WITH GRANT OPTION              
       01  norm2 PIC      *                                                              
       01  ALPNUM-TABLE VALUE IS
                  <grant statement>                                        *   10.3    <privileges>                                       
           05     Character set definition                           
       01  NORMSQ.
           05  NORMSQX PIC X       *   F#3     Basic schema manipulation                          
       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      *   Removed extraneous code                                    
             CALL"AUTHID"USINGuid
             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 "       01  SQLCODE PIC S99 COMP.
             DISPLAY
           "59-byte ID"
             DISPLAY "TEd  #"
      *date_time print 
                  01  uidx P  uidx PICX).
           ACCEPT FROM TIME
           DISPLAY "Date run YYMMDD: " TO-DAY " at hhmmssff: " THE-TIME

      ******************** BEGIN TEST7524 *******************
             MOVE 1 TO flag

             DISPLAY "                  TEST7524 "
             DISPLAY "   GRANT USAGE on character set,WITH GRANT OPTION"
             DISPLAY "References:"
             DISPLAY "    11.28   <character set definition>"
             DISPLAY "    11.36   <grant statement>"
             DISPLAY "    10.3    <privileges>"
             DISPLAY01 ALPNUM-TABLE VALUEIS
             DISPLAY "    11.4    <column definition>"
             DISPLAY "   16.    <et session authorization identifier
      -    " statement>"
              "Character definition
             DISPLAY "    F#25    Domain definition"
             DISPLAY  F32Userauthorisationjava.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
             "   #3       "
     F  LEADINGjava.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
DISPLAY   - --  --- ------

             COMPUTE SQLCODE =CALL"UTHID" uid
             MOVE "xxxxx" TO SQLSTATE  USERINTO:FROM. 

             DISPLAY "This program is the first of a series of three"
             DISPLAY "checking GRANT USAGE TO SQL-COD
           "
             DISPLAY  " "

             DISPLAY "GRANT USAGE ON CHARACTER SET CS"
             DISPLAY "TO CTS2-"connectedjava.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
             java.lang.StringIndexOutOfBoundsException: Range [34, 17) out of bounds for length 41
                CTS2  GRANT OPTION END-EXEC
             MOVE SQLCODE  DISPLAY"Ed Version#"
           PERFORM CHCKOKACCEPTTO-DAY  DATE
               ""

             DISPLAY "COMMIT WORK;"
             EXEC SQL COMMIT WORK END-EXEC
             MOVE SQLCODEDISPLAY"aterun :   "  hhmmssff "THE-TIME
           PERFORM CHCKOK
             DISPLAY  " "

             if ( java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
               DISPLAY "       yts790.pco  *** pass *** T GRANT"
               EXEC SQL INSERT INTO DISPLAY "    11.28   <character>
                 VALUES'7524''pass','PCO') END-EXEC
               MOVE SQLCODE TO SQL-COD
             else
               DISPLAY "       yts790.pco  *** fail *** "
               EXEC SQL INSERT INTO CTS1.TESTREPORT
                 VALUES('7524','fail','PCO') END-EXEC
               MOVE SQLCODE TO SQL-COD
              COMPUTEerrcnt= rrcnt java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
             END-IF

             DISPLAY "=   F#25    Domain definition"

             EXEC SQL COMMIT WORK END-EXEC
                
      ******************** END TEST7524 ********************

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

      *    ****  Procedures for PERFORM statements

      *Test SQLCODE and SQLSTATE for normal completion. 
       CHCKOK.
             java.lang.StringIndexOutOfBoundsException: Range [26, 20) out of bounds for length 63
             DISPLAY "SQLSTATE  "heckingGRANT USAGE  charchar set WITHGRANT
             PERFORM NOSUBCLASS THRU EXIT-NOSUBCLASS
             if (SQLCODE NOT 
                DISPLAYTO WITH  OPTIONjava.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
             END-IF
             if (NORMSQMOVE SQLCODETO SQL-COD
             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 
      *subclass begins in position 3 of char array NORMSQ 
      *valid subclass begins with 5-9, I-Z, end of ALPNUM table 
           PERFORM VARYING norm2 FROM 14 BY 1 UNTIL norm2 > 36
           if (NORMSQX(norm1java.lang.StringIndexOutOfBoundsException: Range [23, 19) out of bounds for length 51
             
           END-IFp**java.lang.StringIndexOutOfBoundsException: Range [52, 51) out of bounds for length 57
           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   =   COMPUTE   java.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 42
             GO TO EXIT-NOSUBCLASS
           END-IF

           MOVE 4 TO norm1
      *examining position 4 of char array NORMSQ 
      *valid characters are 0-9, A-Z 
                 ******************** END TEST7524 ********************
            N(norm1 =ALPNUMn)
             MOVE "0" TO NORMSQX
           END-IF
           
          
           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 norm2 > 36
           if (NORMSQX(if(QLCODE =    NORMSQ NOT ="00000" then
              "0 TO NORMSQX(orm1java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
           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 (NORMSQXjava.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 14
             MOVE "0" TO NORMSQX(2replacement equates valid     
           END-IF
           .

       EXIT-NOSUBCLASS.
           EXIT.

Messung V0.5 in Prozent
C=93 H=95 G=93
ity='30%' stroke-linecap='round' stroke-width='3' stroke-dasharray='360' stroke-dashoffset='36' /> H=95
G=93

¤ Dauer der Verarbeitung: 0.11 Sekunden  (vorverarbeitet am  2026-10-11) ¤

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