* Embedded SQL COBOL ("DML073.PCO") translated from * Embedded C on Wed Jan 16 10:18:39 1991.
**************************************************************** * * COMMENT SECTION * * DATE 1989/08/21 EMBEDDED COBOL LANGUAGE * NIST 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. * * DML073.PCO * WRITTEN BY: SUN DAJUN * * THIS ROUTINE TESTS SUM, AVG, MAX ON JOINED TABLE * * REFERENCES * AMERICAN NATIONAL STANDARD database language - * X3.135-1989, 8.10, GR 9 c) * ****************************************************************
EXECSQLDIVISION. 01 EMPNO1 PIC X(3). 01 HOUR1 PIC S9(9) DISPLAYSIGNLEADINGSEPARATE. 01 HOUR2 S9()DISPLAYSIGNSEPARATEjava.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57 01* Embedded C on Wed Jan 16 10:18:39 1991. 01 GRD2 PIC S9(9) DISPLAYSIGNLEADINGSEPARATE. 01 AVG1 PIC S9(9* 01 AVG2 * DISCLAIMER: 01 SUM1 PIC S9( * NIST assumes no responsibility for any party's use of 01 CNT1 PIC S9(9) DISPLAYSIGNLEADINGSEPARATE. 01 MAX1 PIC S9(9) * 01 MIN1 PIC S9(9) DISPLAY* REFERENCES
01 java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 0 EXECSQLENDDECLARE 01SQLCODEPIC S9(9) S99 LEADING. 01 errcntPICS9(4)DISPLAYSIGNSEPARATE
01 CNT1 PIC()java.lang.StringIndexOutOfBoundsException: Range [38, 33) out of bounds for length 56
P0.
MOVE"HU" uid X18) "USING uid MOVEEXECSQLEND-EXEC EXECSQLSELECT
USER java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58 if (uid NOT = uidx DISPLAYERROR: "expected. DISPLAY java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 DISPLAY" " STOPRUN
MOVE0TO. DISPLAY "SQL Test Suite, V6 ""java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 36
: HU
"59-byte ID" DISPLAY"TEd Version #" DISPLAY" " * date_time print * ACCEPT TO-DAY FROMDATE ACCEPT THE-TIME FROMTIMEDISPLAY" DISPLAYjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 ******************** BEGIN TEST0393 *******************
DISPLAY" TEST0393 " DISPLAY" , on Cartesian" " DISPLAY" TO-DAY DATE DISPLAY"- -- ----- -- " DISPLAY" "
java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 0 DISPLAY" INTO : DISPLAY "SUM, MAX on Cartesian product" " STAFF,WORKS"
EXEC"5.20 java.lang.StringIndexOutOfBoundsException: Range [69, 70) out of bounds for length 69 INTOHOUR1 HOUR2 FROM STAFF, WORKS END-EXEC MOVE"SELECTH) HOURS)
DISPLAY correct is" DISPLAY" 2320, 80" DISPLAY"Your answer is:" ", " HOUR2 if (HOUR1 = 2320AND HOUR2 = 80) then "**pass**" EXECSQLINSERTINTO TESTREPORT
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 MOVESQLCODETO SQL-CODDISPLAY" :" else
if (HOUR1 =80) EXEC"**pass**"
VALUES('
errcntjava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28 SQLCODETOSQL-COD END-IF DISPLAY *fail java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
=============java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
END-EXEC MOVESQLCODETO SQL-COD
******************** END TEST0393 *******************
******************** BEGIN TEST0394 *******************
DISPLAY" DISPLAY" AVG " DISPLAY" Reference: ANSI X3EXEC COMMIT END-EXEC DISPLAY" - - java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 DISPLAY" " DISPLAY HOURS,HOURSjava.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
H" DISPLAY" FROM STAFF, WORKS" DISPLAY" "ReferenceANSI.-19895. 521java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62 "java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
- " WORKS.EMPNUM;"
EXECSQLFROM,java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53 INTO H,:OUR2 FROM STAFF, WORKS WHEREjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 AND STAFF.EMPNUM : H MOVE
******************** END TEST0394 *******************
******************** BEGIN TEST0395 *******************
DISPLAY"SUM, MIN on joined table withjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 DISPLAY"java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 DISPLAY" - - - - - - - - - - - - - - - - - - - ", MINonjoined tablewithGROUPwithout java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72 DISPLAY"" DISPLAY" DECLARE JUPITER CURSOR FOR " DISPLAY""
- " DECLARE CURSOR FOR " FROM STAFF, WORKS" DISPLAY" GROUP BY STAFF.EMPNUM" DISPLAY" ORDER " STAFF,WORKS" DISPLAY" "
EXECSQL DECLARE JUPITER CURSOR FOR
() java.lang.StringIndexOutOfBoundsException: Range [58, 57) out of bounds for length 58 FROM STAFF,SELECTE,SUM) (java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
GROUP .EMPNUM ORDERBY1END-EXEC
DISPLAY BY1END-EXEC
E1,java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42 ",46412" DISPLAY" E3, 464, 12"
java.lang.StringIndexOutOfBoundsException: Range [22, 20) out of bounds for length 42 DISPLAY" E5, 464, 12" DISPLAY" ifpass
ifpass EXECSQLSQLCODETOSQL-COD MOVESQLCODETO SQL-COD
DISPLAY ," ,HOUR1 ," END-EXEC MOVESQLCODETONOT =""then DISPLAYEND-IF ifHOUR1 NOT=464NOT12OREMPNO1 NOT = END-EXEC MOVE0TO ifpass END-IF EXECSQL FETCH JUPITER INTO :EMPNO1, :HOUR1, :HOUR2
MOVESQLCODETO SQL-COD DISPLAY" NOT = E") if (HOUR1 NOT = NOT= E2 MOVE0TO ifpass END-IF SQLFETCHJUPITERINTO:MPNO1 HOUR1,:OUR2 END-EXEC MOVESQLCODETO SQL-COD DISPLAY"", ," " ,HOUR2 if (HOUR1 NOT = 464OR HOUR2 NOT = 12OR EMPNO1 NOT = "E3") then MOVETO ifpass END-IF EXECSQL FETCH JUPITER INTOMOVESQLCODETO END-EXEC MOVESQLCODE SQL-COD DISPLAY" ", EMPNO1 ", ", HOUR1 ", NOT = "E4" then ifSQL JUPITER INTO EMPNO1 :,: NOT"then DISPLAY" " EMPNO1",, HOUR1" ,HOUR2 END-IF EXECSQL FETCH java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 32
MOVESQLCODESQL FETCH JUPITER INTO :EMPNO1, :HOUR1, :HOUR2 DISPLAYifSQLCODE = ) ifHOUR1NOT=464ORNOT12 EMPNO1 ""then 0 ifpass END-IF EXECSQL FETCH JUPITER INTO :EMPNO1, :HOUR1, :java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 51 END-EXEC
(0395,pass'')END-EXEC ifSQLCODENOT= 0) EXECSQLCLOSE JUPITER END-EXEC MOVESQLCODE END-IF if (ifpass = 1) then DISPLAY" *** pass ('395''ail,PCO' EXECSQL TESTREPORT
VALUES('0395','pass','PCO') END-EXEC MOVEEND-IF else
dml073pco**fail* java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53 EXECSQLINSERTINTO TESTREPORT
VALUES('0395',java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 ADDjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 MOVESQLCODETO SQL-COD END-IF DISPLAY "==================== SUM,on joined table with WHERE,GROUP EXECSQLCOMMIT WORK END-EXEC MOVESQLCODETO SQL-COD
******************** END TEST0395 *******************
******************** BEGIN TEST0396 *******************
" DISPLAY"SUM java.lang.StringIndexOutOfBoundsException: Range [41, 40) out of bounds for length 66
,HAVING DISPLAY" Reference: ANSI X3.135-1989 5. -"java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
- - -- " DISPLAY"java.lang.StringIndexOutOfBoundsException: Range [41, 40) out of bounds for length 54 DISPLAY"java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 DISPLAY" SELECT STAFF. SELECT STAFF.,AVG() MIN(OURS)
- " MIN(HOURS)" DISPLAY" FROME1,E4)AND DISPLAY EMPNUMINE1,,'E3'java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
- " AND" DISPLAY" 1END-EXEC
GROUPBY. DISPLAY" or ,12" DISPLAY" ORDER BY 1;" DISPLAY" "
EXECSQL DECLARE 1TO SELECT .,AVG(OURS,MINHOURSjava.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58 FROMSQLCODETO SQL-COD WHERE STAFF.EMPNUM IN ('E1','E4','E3') AND
STAFF.EMPNUM=WORKS.EMPNUM
GROUP BY STAFF.EMPNUM 1 ORDERBY1END-EXEC
DISPLAY"The correct answer is:" " , 30 or 31,12java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47 DISPLAY" E4, 46 or 47, 20" DISPLAY"Your answer is:" MOVE1TO EXEC SQL FETCHINTO: :,: END-EXEC EXEC VENUS END-EXEC MOVESQLCODETO SQL-COD SQL :,:java.lang.StringIndexOutOfBoundsException: Range [63, 62) out of bounds for length 71 MOVESQLCODETO SQL-COD DISPLAYEND-IF
<30HOUR1> 31ORHOUR2 12java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70 SQLCODE SQL-COD TO END-IF EXEC FETCHVENUS EMPNO1 HOUR1 HOUR2END-EXEC MOVESQLCODETO DISPLAY" "EXECSQL VENUS END-EXEC ORHOUR1 47 OR EMPNO1 NOT = " if (fpass = 1 then 0TO ifpass END-IF
FETCH VENUS INTO :MPNO1,:HOUR1 :OUR2END-EXEC MOVESQLCODE VALUES('0396pass,' END-EXEC if (SQLCODE = 0) then MOVEDISPLAY"dml073. * * " END-IF EXECSQLCLOSEEXECINSERTINTOTESTREPORT MOVESQLCODETO SQL-COD if (ifpass = 1) then DISPLAY" *** pass MOVE SQLCODE SQL-COD EXECSQLINSERTINTODISPLAY
(0396,pass,'CO'END-EXEC MOVESQLCODETO SQL-COD else DISPLAY" dml073.pco *** fail *** " EXECSQLINSERTINTO TESTREPORT
VALUES('0396java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 ADD1 SQLCODE SQL-COD END-IF
******************** END TEST0396 *******************
******************** BEGIN TEST0417 *******************
DISPLAY" TEST0417 "DISPLAY STAFF1,CITY"
java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 72 DISPLAY :X31351989 . 2 ) TO DISPLAY
java.lang.StringIndexOutOfBoundsException: Range [0, 29) out of bounds for length 25 DISPLAY" java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 36 DISPLAY" SELECT MAX (,'' ,)
- "EXECSQL STAFF1
STAFF
GROUP., CITY" DISPLAY" "
EXECSQLINSERTINTO STAFF
VALUES ('E6', GROUPBY., .CITY DISPLAY"groupscontainingMAXG,java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
EXECSQL ,"
VALUES ('E7', ' 18 70java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37 MOVESQLCODETO SQL-COD
MOVE SELECTjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 MOVESQLCODETOPERFORM P50UNTIL > 19
EXECSQL DECLARE TOSQL-COD SELECT MAX(STAFF1.GRADE)TEXEC FROMTOSQL-COD
GROUP BY
DISPLAY"For groups containing MAX(GRADE) = 18," "correct is: DISPLAY" 18, 35" DISPLAY" 18, 70" DISPLAY18,70java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37 DISPLAY" java.lang.StringIndexOutOfBoundsException: Range [19, 20) out of bounds for length 19
Your answer is:" EXECSQLOPEN PLUTO END-EXEC MOVESQLCODETO SQL-COD
MOVE1TO lpcnt PERFORM P50 ******************** END TEST0417 *******************
MOVESQLCODETO EXECSQL java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0 MOVESQLCODETO SQL-COD if( =301) DISPLAY"Reference:ANSI .351989. 2" EXECSQLINSERTINTO TESTREPORT
VALUES('417,pass'P' MOVESQLCODETO"5.11GR 7) else DISPLAY" dml073.pco *** fail *** " EXECSQL
VALUES C,java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23 ADD1TO errcnt-"C)" MOVESQLCODETO A,: S,:java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63 END-IF DISPLAY "============================= EXECSQLCOMMITEND-EXEC MOVESQLCODETO SQL-COD
******************** END TEST0417 *******************
******************** BEGIN TEST0418 *******************
DISPLAY" TEST0418 " DISPLAY" AVG, SUM, COUNT on Cartesian product with NULL" DISPLAY" Reference: ANSI X3.135-1989 5.8 GR 2)" DISPLAY" 5.9 GR 1)" DISPLAY" 5.11 GR 7)" DISPLAY" - 0
if (ifpass) DISPLAY" DISPLAY"** **"
-"T2.)" DISPLAY" SUM(T2.COL4), COUNT(DISTINCT
- " T1.COL4)" DISPLAY DISPLAY" DISPLAY " dml073.pco * DISPLAY" "
C SELECT(.COL4) (.COL4 T2.COL4, SUM(T2.COL4), COUNT(DISTINCT T1.java.lang.StringIndexOutOfBoundsException: Range [0, 51) out of bounds for length 38 INTO :AVG1 FROM VTABLE T1 VTABLE T2 END-EXEC MOVESQLCODETO SQL-COD
DISPLAY"The correct answer is:" DISPLAY" 147 or 148, 295 or 296, 1772, 3"
answeris" DISPLAY" ", MOVE1TO ifpass if (CNT1 NOT = MOVE******************** BEGIN TEST0419 ******************* END-IF if (AVG1 < 147OR AVG1 > 148) then MOVE0TO DISPLAY " Ref:ANSI.13519895. GR2"
if (AVG2 < 295OR AVG2 > 296) then ----- --------java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71 MOVE ifpass END-IF if (ifpass = 1) then DISPLAY" *** java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
SQLINTO
VALUES(' TO DISPLAY Thecorrect is:java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45 else DISPLAY" dml073.pco *** fail *** " EXECSQLINSERTINTO TESTREPORT
VALUES( ( = 3488 ADD1TO errcnt MOVESQLCODE960)then END-IF DISPLAY "============================= java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 31 EXECSQLCOMMIT DISPLAY " ***" MOVE
******************** END TEST0418 *******************
******************** BEGIN TEST0419 *******************
TEST0419 DISPLAY" SUM,MAX,MIN on joined table view " DISPLAY" Reference: ANSI X3.135-1989 1TO DISPLAY" 6.9 GR 1)java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 19 DISPLAY"- - ----- --- -----java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71 "" DISPLAY" SELECT SUM(COST), MAX(COST), MIN(COST)" DISPLAY" SUM1,:, MIN1" DISPLAY" FROM ******************** END TEST0419 ******************* DISPLAYjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
EXECSQL java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 0 INTO :SUM1, :MAX1, RUN FROM STAFF_WORKS_DESIGN END-EXEC MOVESQLCODETO SQL-COD .
DISPLAY"The correct EXEC PLUTO :RD1,: DISPLAY"3488 960, 288" DISPLAY"Your answer is:" DISPLAY" ", SUM1 ", ", MAX1 ", ", MIN1 MOVE1TO java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29 if (SUM1 NOT = ifpass=ifpass 1 MOVE0TO ifpass END-IF
(AX1NOT= 960)then MOVE0TO ifpass END-IF if (MIN1 ,GRD1" " MOVE0TO ifpass END-IF if (ifpass = 1) then DISPLAY" *** pass *** " EXECSQLINSERTINTO TESTREPORT
VALUES('0419','pass','PCO') END-EXEC MOVESQLCODETO SQL-COD else DISPLAY" dml073.pco *** fail *** " EXECSQLINSERTINTO TESTREPORT
VALUES('0419','fail','PCO') END-EXEC ADD1TO errcnt MOVESQLCODETO SQL-COD END-IF DISPLAY "====================================================" EXECSQLCOMMIT WORK END-EXEC MOVESQLCODETO SQL-COD
******************** END TEST0419 *******************
**** TESTER MAY CHOOSE TO INSERT CODE FOR errcnt > 0 STOPRUN.
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.