Quellcodebibliothek Statistik Leitseite    (LibreOffice Version 25.8.3.2©)  

Impressum dml179.cob   Sprache: Cobol

 

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


      * EMBEDDED COBOL (file "DML179.PCO")


      ****************************************************************
      *                                                              
      *                 COMMENT SECTION                              
      *                                                              
      * DATE 1996-05-15 EMBEDDED COBOL LANGUAGE                          
      * SQL VALIDATION TEST SUITE V6.0                          
      *  DISCLAIMER:                                                  
      *  This program was written by employees of NIST to test SQL    
      *  implementations for conformance to the SQL standards.        
      *  NIST assumes no responsibility for any party's use of        
      *  this program.
      *                                                              
      * DML179.PCO                                                    
      * WRITTEN BY:  David Flater                                    
      * TRANSLATED AUTOMATICALLY FROM EMBEDDED C BY CHRIS SCHANZLE
      *                                                              
      * This routine tests Intermediate SQL.                         
      *                                                              
      * REFERENCES                                                   
      *   FIPS PUB 127-2 14.2 Intermediate SQL                       
      *   ANSI SQL-1992                                              
      *                                                              
      ****************************************************************





           EXEC SQL BEGIN DECLARE SECTION END-EXEC
       01  SQLCODE PIC S9(9) COMP.
       01  SQLSTATE PIC  X(5).
       01  uid PIC  X(18).
       01  uidx PIC  X(18).
       01  longst PIC  X(4000).
       01  int1 PIC S9(9) DISPLAY SIGN LEADING SEPARATE.
             EXEC SQL END DECLARE SECTION END-EXEC

       01  longst-value.
           02  filler  pic x(71) value "INSERT INTO T0892 (INTKEY, NAAM,
      -          " ADDRESS, KEYWORDS, DESCRIPT3) VALUES (".
           02  filler  pic x(71) value "0, 'John".
           02  filler  pic x(68) value spaces.
           02  filler  pic x(68) value spaces.
           02  filler  pic x(68) value spaces.
           02  filler  pic x(68) value spaces.
           02  filler  pic x(68) value spaces.
           02  filler  pic x(68) value spaces.
           02  filler  pic x(68) value spaces.
           02  filler  pic x(68) value spaces.
           02  filler  pic x(68) value spaces.
           02  filler  pic x(68) value spaces.
           02  filler  pic x(68) value spaces.
           02  filler  pic x(68) value spaces.
           02  filler  pic x(68) value spaces.
           02  filler  pic x(52) value "                                
      -          "            Smith', ".
           02  filler  pic x(68) value "'1313 Osprey Alley".
           02  filler  pic x(68) value spaces.
           02  filler  pic x(68) value spaces.
           02  filler  pic x(68) value "Box 35B Sector 28 Quadrant 3".                                        ".
           02  filler  pic x(68) value spaces.
           02  filler  pic x(68) value spaces.
           02  filler  pic x(68) value spaces.
           02  filler  pic x(68) value "Rural Route 29837-39234234324-XR
      -          "Z".
           02  filler  pic x(68) value spaces.
           02  filler  pic x(68) value spaces.
           02  filler  pic x(68) value spaces.
           02  filler  pic x(68) value "Beverly Hills, CA".
           02  filler  pic x(68) value spaces.
           02  filler  pic x(68) value spaces.
           02  filler  pic x(52) value "                                
      -          "            90210', ".
           02  filler  pic x(68) value "'aardvark osprey          metrol
     -          "gy".
lerpic x)  spacesjava.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
           02  filler  pic x(68) value spaces.
           02  filler  pic x(68) value "synthetic             
      -          "P".
           02  filler      *                 COMMENT SECTION                              
           02  filler  pic      * DATE 1996-05-15 EMBEDDED COBOL LANGUAGE                          
      -          " quadruped cattle".
           02  filler  pic x(      *  This program was written by employees of NIST to test SQL    
           02  filler  pic      *   FIPS PUB 127-2 14.2 Intermediate SQL                       
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
           02  filler  01   PIC()COMP.
             filler  pic (68  spacesjava.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
           02  filler  pic x(        uidx X18.
           02  filler  pic x(68) value "java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 31
           02  filler  pic x(68) value spaces.
           02  filler  pic x(68) value spacesjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
            filler  pic() value"java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
      -          "          gravity',".
           02 pic x()value "filler filler blah  
      -          "                x() value ",'ohn.
           02  filler  pic x(68) value spaces           02     x68 value spaces.
            spaces.
           02  filler                picx)  spaces.
             filler  pic x()value .
           02  filler pic (68value .
           02  filler  pic x(68) value spaces.
           02  filler  pic x(68) 02  filler  )valuespaces.
            filler   x68 value spaces.
             pic x68)spacesjava.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
           02  filler  picx()value spaces.
                x68) .
           02  filler  pic x02filler   x()value                                 
           02             02  fillerfillerpic()  "1313  Alley"java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
                ).

       01  norm1 PIC S90268"  .                                       
      norm2S9  SIGNSEPARATE
       01  ALPNUM-TABLE 02  filler  pic xspaces
789"
           05        -""java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
       01  .
           05  NORMSQXX OCCURSTIMES.
01errcnt S99 DISPLAY  SEPARATE
      *date_time declaration 
       01  TO-DAY 02  filler x52)value java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
       01  THE-TIME 02  filler  (68)value"aardvark osprey          java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
       01  flag 02  fillerpic()valuespaces

       01  SQL-COD PIC S9(9) DISPLAY SIGN"

       PROCEDURE  fillerx68)           gnuyak
       java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10

             MOVE "FLATER02picx) value"CORBAIDLAmste
             CALL "      -          "rdam""rdam".
             MOVE "not logged in, not" TO uidx
USER :idx FROM HU.CCOEND-EXEC
             MOVE SQLCODE TO SQL-COD
              SQL ROLLBACK WORK END-EXEC
           02  picx68) java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
             if (uid  NOT  =   uidx) then
               DISPLAY "ERROR: User ", uid, " java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 46
      -    " connected           02    filler  pic x(68) value spaces.
            STOP RUN
             END-IF
              0 TO errcnt

             DISPLAY
           "SQL Test Suite, V6.0, Embedded COBOL, dml179.pco      -          "lah.
             DISPLAY
           "59-byte ID"
             DISPLAY "TEd Version #"
      *date_time print 
           ACCEPT            02  filler filler x()valuespacesjava.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
           ACCEPT THE-TIME FROM TIMEspacesjava.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
                       filler  picx( valuespaces.

      ******************** BEGIN TEST0892 *******************
             MOVE 1 TO           02filler  pic (65 valuespaces.

             DISPLAY "              FIPS 
             " sizing  = 8000,statement  >java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
           4000"
             DISPLAY "References:"
             DISPLAY "  FIPS 16.6 -- Sizing #27, Length of a row"
             DISPLAY "                 "ABCDEFGH56789IJKLMNOPQRSTUVWXYZ
          "statement >java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
DISPLAY" FIPS 166-- #,CHARACTER  
      -    " length"
DISPLAY "   - ----------- --- -- "

                   *date_time declaration 
xx  SQLSTATE

      *twice the number of columns   18 
      *length of char strings    7978 
      *decimal precision plus 1 of each exact numeric column  4 

             DISPLAY "CREATE TABLE T0892 ("
             DISPLAY " INTKEY NUMERIC 3 PRIMARY KEY,
             java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 0
             DISPLAY "  ADDRESS VARCHAR (1000),"
            DISPLAY"  KEYWORDS VARCHAR (1000),"
             DISPLAY "  FUNCTION1 VARCHAR (1000),"
             DISPLAY "  FUNCTION2 VARCHAR (1000),"
             DISPLAY"  DESCRIPT1 VARCHAR (1000),"
             DISPLAY "  DESCRIPT2 VARCHAR (1000),"
             DISPLAY "  DESCRIPT3 VARCHAR (978));"
             EXEC SQL CREATE TABLE              MOVE SQLCODETO 
               INTKEY NUMERIC (3)             SQLCODE  SQL-COD
               NAAM (1000),
               ADDRESS VARCHAR                 "RROR:User" ,  expected.User" uidx,java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
                 ()java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
               FUNCTION1 VARCHAR (1000
               FUNCTION2            "SQL Test Suite, V6EmbeddedCOBOL,dml179.co
                          59byteID
               DESCRIPT2 VARCHAR (1000),
               DESCRIPT3 VARCHAR (978)) END-EXECACCEPT TO-DAY FROM 
  TOjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
           PERFORM"FIPS  "
             DISPLAY  " "

DISPLAY"WORK;java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
               COMMIT END-EXEC
             MOVE SQLCODE TODISPLAY"FIPS 166- Sizing#27 Length of a row"
           PERFORM CHCKOK
               " "

             MOVE longst-value TO longst
             DISPLAY"The   java.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 66
             "    -   - ---   - ----
             DISPLAY longst

             DISPLAY java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
              "xxxx"TO
                   *twice the number of columns   18 
           PERFORM CHCKOK
             DISPLAY  " "

             DISPLAY "UPDATE T0892"
             DISPLAY  FUNCTION1 =
             DISPLAY              "INTKEY NUMERIC ()PRIMARY KEY,"
      -    " of the '"
             DISPLAY "'Materials '"
             DISPLAY "'Blasting Laboratory in the National Cattle
      -    "Acceleration '"
             DISPLAY "'Project of '"
             DISPLAY "'             DISPLAY "  KEYWORDSVARCHAR (1000),"
      -                 DISPLAY "FUNCTION1  (1000),java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
             DISPLAY                 DESCRIPT1 (1000)"
             DISPLAY 978)
      -" of'java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
             DISPLAY "'materials '"
             DISPLAY"'usedinthetrebuchet.  He served ten years as
      -    " the '"
             DISPLAY               VARCHAR(000,
             DISPLAY  FUNCTION1 1000)
           thejava.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
            "Pennsylvania'
             DISPLAY               VARCHAR 978)END-EXEC
      -    " '"
             DISPLAY "'java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
             DISPLAY "'as a world-class graffiti artist and source of
      -    " all good '"
             DISPLAY "'             MOVE SQLCODE T
             DISPLAY ' in poorweather.He is
      -java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
             DISPLAY T statementa
             DISPLAY "'paperback novels, java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 34
      -
             DISPLAY"Pumpkinswill Fit '
             DISPLAYEXEC   : 
      -"Useless Things 'java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
             DISPLAY"that Don't'
             DISPLAY "'Want java.lang.StringIndexOutOfBoundsException: Range [0, 30) out of bounds for length 0
"
             DISPLAY "'Head without '"
              ' worksRedundancy  
            -"of  'java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
' '
             DISPLAY "'java.lang.StringIndexOutOfBoundsException: Range [0, 31) out of bounds for length 28
      -    "              DISPLAY lower  jobto the
                          DISPLAYjava.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 36
- java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 26
             DISPLAYDISPLAY' intrebuchet  served
                          java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 43
               java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 30
               Harry inthejava.lang.StringIndexOutOfBoundsException: Range [46, 45) out of bounds for length 67
' java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 34
               java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
               'Acceleration             "'
'    tojava.lang.StringIndexOutOfBoundsException: Range [56, 55) out of bounds for length 61
      -   "all  'java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
               'correlate the loft and acceleration              "to   poor weather.  isis
               'quality of DISPLAY "'ten thousand
'  the trebuchet. served ten  '
               'as the java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 20
               'charge of marketing in the now             "the ofa ,""A   java.lang.StringIndexOutOfBoundsException: Range [65, 66) out of bounds for length 65
' of '
'java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 64
               DISPLAY'without'java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
'
               'all good bits related '
               'to            ANSI 'java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
               'authorof  ten  java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
               'paperback novels, java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 33
'Pumpkins will Fit '
               'on the Head of a Pin," "A Whole Bunch of Useless '
               SPLAY"WHERE INTKEY = 0;"
               'Want to Know," and "How to Lift Heavy Things '
               'Over yourHeadwithout '
               'Hurting Yourself or Dropping Them."  He attends '
                andISO standards '
               'meetings in his copious free time and funds the '

               'suites with his                'fthe Materials java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
               WHERE INTKEY =0END-EXEC
             MOVE SQLCODE TO SQL-COD               AccelerationProjectofjava.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
           PERFORMCHCKOK
             DISPLAY                 correlate and versus java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64

             DISPLAY "UPDATE T0892"
             DISPLAY "  SET                'trust of the Pennsylvania
             DISPLAY "DESCRIPT1 = FUNCTION1,"
             DISPLAY "  DESCRIPT2 = FUNCTION1,"
             DISPLAY "  DESCRIPT3 = SUBSTRING (FUNCTION1 FROM 1 FOR
      -    " 978);"
             EXEC SQL UPDATE T0892
               SET FUNCTION2 = FUNCTION1,
               DESCRIPT1 = FUNCTION1,
               DESCRIPT2 = FUNCTION1,
               DESCRIPT3 = SUBSTRING (FUNCTION1 FROM 1 FOR 978) END-EXEC
             MOVE'aperback ,including such  '
           PERFORM' theHead  Pin" " WholeBunch  Useless '
             DISPLAY  " "

             MOVE 0 TO int1
DISPLAY"SELECT CHAR_LENGTH (NAAM) +java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
             DISPLAY "                CHAR_LENGTH               Hurting Yourself or Dropping Them.  He attends '
DISPLAY"                CHAR_LENGTH (KEYWORDS) +"
             DISPLAY "                CHAR_LENGTH (FUNCTION1) +"
             DISPLAY "                java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 47
            DISPLAY "                CHAR_LENGTH (DESCRIPT1) +"
             DISPLAY "               CHAR_LENGTH (DESCRIPT2) +"
             DISPLAY "                CHAR_LENGTH (DESCRIPT3           PERFORM CHCKOK
             DISPLAY "  INTO
             DISPLAY "  FROM              DISPLAY "  SET FUNCTIO = FUNCTION1,"
             DISPLAY "  WHERE INTKEY = 0;"
             EXEC SQL SELECT CHAR_LENGTH (NAAM) +
                (DDRESS+
               CHAR_LENGTH (KEYWORDS) +
               CHAR_LENGTH (FUNCTION1) +
               CHAR_LENGTHSQL T0892
                ()+
                (DESCRIPT2+
                =,
                DESCRIPT3=SUBSTRING(UNCTION1FROM1  978) 
               FROM T0892 SQLCODE  SQL-COD
EY=0
             MOVE SQLCODE TO SQL-COD

              int1shouldbe8000;valuejava.lang.StringIndexOutOfBoundsException: Range [56, 55) out of bounds for length 63
             if (DISPLAY                  Ajava.lang.StringIndexOutOfBoundsException: Range [59, 58) out of bounds for length 62
               MOVE 0 TO flag
             END-IF

             DISPLAY                 java.lang.StringIndexOutOfBoundsException: Range [61, 60) out of bounds for length 64
             SQL WORK
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY  " "

             DISPLAY DROPCASCADE"
             EXEC SQL DROP TABLE T0892 CASCADE END-EXEC
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY  " "

             DISPLAY "COMMIT WORK;"
             EXEC SQL COMMIT WORK END-EXEC
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY  " "

             if   TOSQL-COD
               DISPLAY "                *** pass *** "
               EXEC SQL INSERT              if (int1  NOT =  8000)
                              END-IF
               MOVE SQLCODE TO SQL-COD
             else
DISPLAY "dml179.  ** fail **"
               EXEC SQL INSERT INTO HU.TESTREPORT
                 VALUES('0892','fail','             EXEC SQLDROP TABLE T0892 CASCADE 
               MOVE SQLCODE TO SQL-COD
               COMPUTE java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 25
             END-IF

             "========================="

             EXEC SQL COMMIT WORK END-EXEC
             MOVE SQLCODE TO java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 25
      ******************** END TEST0892 ********************
      **** 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; its value is ", SQL-COD
             DISPLAY "SQLSTATE should be 00000; its value is ", SQLSTATE
            NOSUBCLASSTHRU
             if (SQLCODEelse
0
             END-IF
             if (NORMSQ = "00000"                   (0892,fail'PCO)END-EXEC
             then
               DISPLAY "Valid implementation-definedEND-IF
             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  

              
      *subclass begins in position 3 of char array NORMSQ 
      *valid subclass begins with 5-9, I-Z, end of ALPNUM table 
                     PERFORM VARYING java.lang.StringIndexOutOfBoundsException: Range [62, 32) out of bounds for length 62
           if (NORMSQX               DISPLAY "Valid implementation-defined SQLSTATE accepted.java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
             MOVE "0" TO       *subclasses with 000.  This replacement equates valid     
           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   =         *subclass begins in position 3 of char array NORMSQ 
             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           java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
           if (NORMSQX(norm1      *so proceed to zero it out, if valid (0-9,A-Z)            
             MOVE""TONORMSQX(orm1
           END-IF
           END-PERFORM
          
           MOVE 5 TO norm1
      *valid characters are 0-9, A-Z 
      *examining position 5 of char array NORMSQ 
           PERFORM VARYING      *examining position 4 of char array NORMSQ 
           if           VARYING  FROM1BY1 UNTILnorm2>java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
 NORMSQX)
           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"            (NORMSQX(norm1)  =  ALPNUM(norm2)) then
             MOVE "0" TO             MOVE"0"TO NORMSQXnorm1)
           END-IF
           .

       EXIT-NOSUBCLASS.
           EXIT.

Messung V0.5 in Prozent
C=94 H=98 G=95

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