* Standard COBOL (file "DML147.SCO") calling SQL * procedures in file "DML147.MCO".
**************************************************************** * * COMMENT SECTION * * DATE 1995/2/1 STANDARD 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. * * DML147.SCO * WRITTEN BY: Joan Sullivan (mostly) * TRANSLATED AUTOMATICALLY FROM EMBEDDED COBOL BY CHRIS SCHANZLE * Standard COBOL by David Flater * * This routine tests (1) the rolling back of schema * manipulation, and (2) queries involving joins. * * REFERENCES * FIPS PUB 127-2 14.1 Transitional SQL * ANSI SQL-1992 * ****************************************************************
*This is a syntax error. If it is rejected at compile time, *this portion of the test is passed.
DISPLAY"INSERT INTO NOT_THERE VALUES ('1234567890');" * EXEC SQL INSERT INTO NOT_THERE VALUES ('1234567890') * ; CALL"SUB5"USINGSQLCODE SQLSTATE MOVESQLCODETO SQL-COD DISPLAY"SQLCODE should be < 0; its value is ", SQL-COD if (SQLCODENOT < 0) then MOVE0TO flag END-IF DISPLAY"SQLSTATE should be 42000; its value is ", SQLSTATE PERFORM NOSUBCLASS THRU EXIT-NOSUBCLASS if (NORMSQ NOT = "42000") then MOVE0TO flag END-IF if (NORMSQ = "42000"AND NORMSQ NOT = SQLSTATE) then DISPLAY"Valid implementation-defined SQLSTATE accepted." END-IF
*This is a syntax error. If it is rejected at compile time, *this portion of the test is passed.
DISPLAY"SELECT COUNT (*) INTO :int1" DISPLAY" FROM NOT_HERE;" * EXEC SQL SELECT COUNT (*) INTO :int1 * FROM NOT_HERE; CALL"SUB9"USINGSQLCODE SQLSTATE int1 MOVESQLCODETO SQL-COD DISPLAY"SQLCODE should be < 0; its value is ", SQL-COD if (SQLCODENOT < 0) then MOVE0TO flag END-IF DISPLAY"SQLSTATE should be 42000; its value is ", SQLSTATE PERFORM NOSUBCLASS THRU EXIT-NOSUBCLASS if (NORMSQ NOT = "42000") then MOVE0TO flag END-IF if (NORMSQ = "42000"AND NORMSQ NOT = SQLSTATE) then DISPLAY"Valid implementation-defined SQLSTATE accepted." END-IF
*This is a syntax error. If it is rejected at compile time, *this portion of the test is passed.
DISPLAY"SELECT COUNT (*) INTO :int1" DISPLAY" FROM USIG WHERE NUL IS NULL;" * EXEC SQL SELECT COUNT (*) INTO :int1 * FROM USIG WHERE NUL IS NULL; CALL"SUB13"USINGSQLCODE SQLSTATE int1 MOVESQLCODETO SQL-COD DISPLAY"SQLCODE should be < 0; its value is ", SQL-COD if (SQLCODENOT < 0) then MOVE0TO flag END-IF DISPLAY"SQLSTATE should be 42000; its value is ", SQLSTATE PERFORM NOSUBCLASS THRU EXIT-NOSUBCLASS if (NORMSQ NOT = "42000") then MOVE0TO flag END-IF if (NORMSQ = "42000"AND NORMSQ NOT = SQLSTATE) then DISPLAY"Valid implementation-defined SQLSTATE accepted." END-IF
MOVE50TO int1 DISPLAY"SELECT COUNT(*) INTO :int1" DISPLAY" FROM U_SIG;" * EXEC SQL SELECT COUNT(*) INTO :int1 * FROM U_SIG; CALL"SUB17"USINGSQLCODE SQLSTATE int1 MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"int1 should be 2; its value is ", int1 if (int1 NOT = 2) then MOVE0TO flag END-IF
MOVE50TO int1 DISPLAY"SELECT COUNT(*) INTO :int1" DISPLAY" FROM USIG;" * EXEC SQL SELECT COUNT(*) INTO :int1 * FROM USIG; CALL"SUB19"USINGSQLCODE SQLSTATE int1 MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"int1 should be 2; its value is ", int1 if (int1 NOT = 2) then MOVE0TO flag END-IF
MOVE"xxx"TO en DISPLAY"FETCH C14721 INTO :en;" * EXEC SQL FETCH C14721 INTO :en; CALL"SUB27"USINGSQLCODE SQLSTATE en MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"en should be 'E5 '; its value is '", en, "'" if (en NOT = "E5 ") then MOVE0TO flag END-IF
MOVE"xxx"TO en DISPLAY"FETCH C14721 INTO :en;" * EXEC SQL FETCH C14721 INTO :en; CALL"SUB28"USINGSQLCODE SQLSTATE en MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"en should be 'E4 '; its value is '", en, "'" if (en NOT = "E4 ") then MOVE0TO flag END-IF
DISPLAY"FETCH C14721 INTO :en;" * EXEC SQL FETCH C14721 INTO :en; CALL"SUB29"USINGSQLCODE SQLSTATE en MOVESQLCODETO SQL-COD DISPLAY"SQLCODE should be 100; its value is ", SQL-COD DISPLAY"SQLSTATE should be 02000; its value is ", SQLSTATE PERFORM NOSUBCLASS THRU EXIT-NOSUBCLASS if (SQLCODENOT = 100OR NORMSQ NOT = "02000") then MOVE0TO flag END-IF if (NORMSQ = "02000"AND NORMSQ NOT = SQLSTATE) then DISPLAY"Valid implementation-defined SQLSTATE accepted." END-IF DISPLAY" "
MOVE"xxx"TO en DISPLAY"FETCH C14722 INTO :en;" * EXEC SQL FETCH C14722 INTO :en; CALL"SUB32"USINGSQLCODE SQLSTATE en MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"en should be 'E4 '; its value is '", en, "'" if (en NOT = "E4 ") then MOVE0TO flag END-IF
MOVE"xxx"TO en DISPLAY"FETCH C14722 INTO :en;" * EXEC SQL FETCH C14722 INTO :en; CALL"SUB33"USINGSQLCODE SQLSTATE en MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"en should be 'E5 '; its value is '", en, "'" if (en NOT = "E5 ") then MOVE0TO flag END-IF
DISPLAY"FETCH C14722 INTO :en;" * EXEC SQL FETCH C14722 INTO :en; CALL"SUB34"USINGSQLCODE SQLSTATE en MOVESQLCODETO SQL-COD DISPLAY"SQLCODE should be 100; its value is ", SQL-COD DISPLAY"SQLSTATE should be 02000; its value is ", SQLSTATE PERFORM NOSUBCLASS THRU EXIT-NOSUBCLASS if (SQLCODENOT = 100OR NORMSQ NOT = "02000") then MOVE0TO flag END-IF if (NORMSQ = "02000"AND NORMSQ NOT = SQLSTATE) then DISPLAY"Valid implementation-defined SQLSTATE accepted." END-IF DISPLAY" "
MOVE"xxx"TO en DISPLAY"FETCH C14723 INTO :en;" * EXEC SQL FETCH C14723 INTO :en; CALL"SUB37"USINGSQLCODE SQLSTATE en MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"en should be 'E1 '; its value is '", en, "'" if (en NOT = "E1 ") then MOVE0TO flag END-IF
MOVE"xxx"TO en DISPLAY"FETCH C14723 INTO :en;" * EXEC SQL FETCH C14723 INTO :en; CALL"SUB38"USINGSQLCODE SQLSTATE en MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"en should be 'E2 '; its value is '", en, "'" if (en NOT = "E2 ") then MOVE0TO flag END-IF
MOVE"xxx"TO en DISPLAY"FETCH C14723 INTO :en;" * EXEC SQL FETCH C14723 INTO :en; CALL"SUB39"USINGSQLCODE SQLSTATE en MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"en should be 'E3 '; its value is '", en, "'" if (en NOT = "E3 ") then MOVE0TO flag END-IF
MOVE"xxx"TO en DISPLAY"FETCH C14723 INTO :en;" * EXEC SQL FETCH C14723 INTO :en; CALL"SUB40"USINGSQLCODE SQLSTATE en MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"en should be 'E4 '; its value is '", en, "'" if (en NOT = "E4 ") then MOVE0TO flag END-IF
MOVE"xxx"TO en DISPLAY"FETCH C14723 INTO :en;" * EXEC SQL FETCH C14723 INTO :en; CALL"SUB41"USINGSQLCODE SQLSTATE en MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"en should be 'E5 '; its value is '", en, "'" if (en NOT = "E5 ") then MOVE0TO flag END-IF
DISPLAY"FETCH C14723 INTO :en;" * EXEC SQL FETCH C14723 INTO :en; CALL"SUB42"USINGSQLCODE SQLSTATE en MOVESQLCODETO SQL-COD DISPLAY"SQLCODE should be 100; its value is ", SQL-COD DISPLAY"SQLSTATE should be 02000; its value is ", SQLSTATE PERFORM NOSUBCLASS THRU EXIT-NOSUBCLASS if (SQLCODENOT = 100OR NORMSQ NOT = "02000") then MOVE0TO flag END-IF if (NORMSQ = "02000"AND NORMSQ NOT = SQLSTATE) then DISPLAY"Valid implementation-defined SQLSTATE accepted." END-IF DISPLAY" "
DISPLAY"INSERT INTO STAFF66" DISPLAY" SELECT GRADE*1000, EMPNAME, GRADE, EMPNUM" DISPLAY" FROM HU.STAFF3 WHERE EMPNUM > 'E2';" * EXEC SQL INSERT INTO STAFF66 * SELECT GRADE*1000, EMPNAME, GRADE, EMPNUM * FROM HU.STAFF3 WHERE EMPNUM > 'E2'; CALL"SUB50"USINGSQLCODE SQLSTATE MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY" "
DISPLAY"UPDATE HU.STAFF3 SET EMPNUM = 'E6' WHERE EMPNUM =
- " 'E5';" * EXEC SQL UPDATE HU.STAFF3 SET EMPNUM = 'E6' WHERE EMPNUM = * 'E5'; CALL"SUB51"USINGSQLCODE SQLSTATE MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY" "
DISPLAY"UPDATE HU.STAFF3 SET EMPNAME = 'Ali' WHERE GRADE =
- " 12;" * EXEC SQL UPDATE HU.STAFF3 SET EMPNAME = 'Ali' WHERE GRADE = * 12; CALL"SUB52"USINGSQLCODE SQLSTATE MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY" "
*7.5 SR 6 d *Table STAFF66 has 3 rows, only 1 matching on all columns
MOVE"xxxxxxxxxxxxxxxxxxxx"TO ename MOVE0TO gr MOVE"xxx"TO en MOVE0TO sl MOVE"xxxxxxxxxxxxxxx"TO ct DISPLAY"SELECT * INTO :ename, :gr, :en, :sl, :ct FROM" DISPLAY" STAFF66 NATURAL INNER JOIN HU.STAFF3;" * EXEC SQL SELECT * INTO :ename, :gr, :en, :sl, :ct FROM * STAFF66 NATURAL INNER JOIN HU.STAFF3; CALL"SUB53"USINGSQLCODE SQLSTATE ename gr en sl ct MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"ename should be 'Carmen '; its value
- " is '", ename, "'" DISPLAY"gr should be 13; its value is ", gr DISPLAY"en should be 'E3 '; its value is '", en, "'" DISPLAY"sl should be 13000; its value is ", sl DISPLAY"ct should be 'Vienna '; its value is '",
ct, "'" if (gr NOT = 13OR sl NOT = 13000) then MOVE0TO flag END-IF if (ename NOT = "Carmen "OR en NOT = "E3 ") then MOVE0TO flag END-IF if (ct NOT = "Vienna ") then MOVE0TO flag END-IF
DISPLAY"DECLARE C14731 CURSOR FOR" DISPLAY" SELECT EMPNUM, EMPNAME, SALARY FROM" DISPLAY" HU.STAFF3 NATURAL LEFT OUTER JOIN STAFF66" DISPLAY" WHERE EMPNUM > 'E1'" DISPLAY" ORDER BY EMPNUM ASC;" * EXEC SQL DECLARE C14731 CURSOR FOR * SELECT EMPNUM, EMPNAME, SALARY FROM * HU.STAFF3 NATURAL LEFT OUTER JOIN STAFF66 * WHERE EMPNUM > 'E1' * ORDER BY EMPNUM ASC END-EXEC
MOVE"xxx"TO en MOVE"xxxxxxxxxxxxxxxxxxxx"TO ename MOVE0TO indic1 DISPLAY"FETCH C14731 INTO :en, :ename, :sl:indic1;" * EXEC SQL FETCH C14731 INTO :en, :ename, :sl:indic1; CALL"SUB55"USINGSQLCODE SQLSTATE en ename sl indic1 MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"en should be 'E2 '; its value is '", en, "'" DISPLAY"ename should be 'Betty '; its value
- " is '", ename, "'" DISPLAY"indic1 should be -1; its value is ", indic1 if (en NOT = "E2 "OR indic1 NOT = -1) then MOVE0TO flag END-IF if (ename NOT = "Betty ") then MOVE0TO flag END-IF
MOVE"xxx"TO en MOVE"xxxxxxxxxxxxxxxxxxxx"TO ename COMPUTE indic1 = -1 MOVE0TO sl DISPLAY"FETCH C14731 INTO :en, :ename, :sl:indic1;" * EXEC SQL FETCH C14731 INTO :en, :ename, :sl:indic1; CALL"SUB56"USINGSQLCODE SQLSTATE en ename sl indic1 MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"en should be 'E3 '; its value is '", en, "'" DISPLAY"ename should be 'Carmen '; its value
- " is '", ename, "'" DISPLAY"sl should be 13000; its value is ", sl DISPLAY"indic1 should be 0; its value is ", indic1 if (en NOT = "E3 "OR indic1 NOT = 0) then MOVE0TO flag END-IF if (ename NOT = "Carmen "OR sl NOT = 13000) then MOVE0TO flag END-IF
MOVE"xxx"TO en MOVE"xxxxxxxxxxxxxxxxxxxx"TO ename MOVE0TO indic1 DISPLAY"FETCH C14731 INTO :en, :ename, :sl:indic1;" * EXEC SQL FETCH C14731 INTO :en, :ename, :sl:indic1; CALL"SUB57"USINGSQLCODE SQLSTATE en ename sl indic1 MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"en should be 'E4 '; its value is '", en, "'" DISPLAY"ename should be 'Ali '; its value
- " is '", ename, "'" DISPLAY"indic1 should be -1; its value is ", indic1 if (en NOT = "E4 "OR indic1 NOT = -1) then MOVE0TO flag END-IF if (ename NOT = "Ali ") then MOVE0TO flag END-IF
MOVE"xxx"TO en MOVE"xxxxxxxxxxxxxxxxxxxx"TO ename MOVE0TO indic1 DISPLAY"FETCH C14731 INTO :en, :ename, :sl:indic1;" * EXEC SQL FETCH C14731 INTO :en, :ename, :sl:indic1; CALL"SUB58"USINGSQLCODE SQLSTATE en ename sl indic1 MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"en should be 'E6 '; its value is '", en, "'" DISPLAY"ename should be 'Ed '; its value
- " is '", ename, "'" DISPLAY"indic1 should be -1; its value is ", indic1 if (en NOT = "E6 "OR indic1 NOT = -1) then MOVE0TO flag END-IF if (ename NOT = "Ed ") then MOVE0TO flag END-IF
DISPLAY"FETCH C14731 INTO :en, :ename, :sl:indic1;" * EXEC SQL FETCH C14731 INTO :en, :ename, :sl:indic1; CALL"SUB59"USINGSQLCODE SQLSTATE en ename sl indic1 MOVESQLCODETO SQL-COD DISPLAY"SQLCODE should be 100; its value is ", SQL-COD DISPLAY"SQLSTATE should be 02000; its value is ", SQLSTATE PERFORM NOSUBCLASS THRU EXIT-NOSUBCLASS if (SQLCODENOT = 100OR NORMSQ NOT = "02000") then MOVE0TO flag END-IF if (NORMSQ = "02000"AND NORMSQ NOT = SQLSTATE) then DISPLAY"Valid implementation-defined SQLSTATE accepted." END-IF DISPLAY" "
MOVE"xxx"TO en MOVE"xxxxxxxxxxxxxxxxxxxx"TO ename COMPUTE indic1 = -1 MOVE0TO sl DISPLAY"FETCH C14732 INTO :en, :ename, :sl:indic1;" * EXEC SQL FETCH C14732 INTO :en, :ename, :sl:indic1; CALL"SUB62"USINGSQLCODE SQLSTATE en ename sl indic1 MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"en should be 'E5 '; its value is '", en, "'" DISPLAY"ename should be 'Ed '; its value
- " is '", ename, "'" DISPLAY"sl should be 13000; its value is ", sl DISPLAY"indic1 should be 0; its value is ", indic1 if (en NOT = "E5 "OR indic1 NOT = 0) then MOVE0TO flag END-IF if (ename NOT = "Ed "OR sl NOT = 13000) then MOVE0TO flag END-IF
MOVE"xxx"TO en MOVE"xxxxxxxxxxxxxxxxxxxx"TO ename COMPUTE indic1 = -1 MOVE0TO sl DISPLAY"FETCH C14732 INTO :en, :ename, :sl:indic1;" * EXEC SQL FETCH C14732 INTO :en, :ename, :sl:indic1; CALL"SUB63"USINGSQLCODE SQLSTATE en ename sl indic1 MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"en should be 'E4 '; its value is '", en, "'" DISPLAY"ename should be 'Don '; its value
- " is '", ename, "'" DISPLAY"sl should be 12000; its value is ", sl DISPLAY"indic1 should be 0; its value is ", indic1 if (en NOT = "E4 "OR indic1 NOT = 0) then MOVE0TO flag END-IF if (ename NOT = "Don "OR sl NOT = 12000) then MOVE0TO flag END-IF
MOVE"xxx"TO en MOVE"xxxxxxxxxxxxxxxxxxxx"TO ename COMPUTE indic1 = -1 MOVE0TO sl DISPLAY"FETCH C14732 INTO :en, :ename, :sl:indic1;" * EXEC SQL FETCH C14732 INTO :en, :ename, :sl:indic1; CALL"SUB64"USINGSQLCODE SQLSTATE en ename sl indic1 MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"en should be 'E3 '; its value is '", en, "'" DISPLAY"ename should be 'Carmen '; its value
- " is '", ename, "'" DISPLAY"sl should be 13000; its value is ", sl DISPLAY"indic1 should be 0; its value is ", indic1 if (en NOT = "E3 "OR indic1 NOT = 0) then MOVE0TO flag END-IF if (ename NOT = "Carmen "OR sl NOT = 13000) then MOVE0TO flag END-IF
MOVE"xxx"TO en MOVE"xxxxxxxxxxxxxxxxxxxx"TO ename MOVE0TO indic1 MOVE0TO sl DISPLAY"FETCH C14732 INTO :en, :ename, :sl:indic1;" * EXEC SQL FETCH C14732 INTO :en, :ename, :sl:indic1; CALL"SUB65"USINGSQLCODE SQLSTATE en ename sl indic1 MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"en should be 'E2 '; its value is '", en, "'" DISPLAY"ename should be 'Betty '; its value
- " is '", ename, "'" DISPLAY"indic1 should be -1; its value is ", indic1 if (en NOT = "E2 "OR indic1 NOT = -1) then MOVE0TO flag END-IF if (ename NOT = "Betty ") then MOVE0TO flag END-IF
DISPLAY"FETCH C14732 INTO :en, :ename, :sl:indic1;" * EXEC SQL FETCH C14732 INTO :en, :ename, :sl:indic1; CALL"SUB66"USINGSQLCODE SQLSTATE en ename sl indic1 MOVESQLCODETO SQL-COD DISPLAY"SQLCODE should be 100; its value is ", SQL-COD DISPLAY"SQLSTATE should be 02000; its value is ", SQLSTATE PERFORM NOSUBCLASS THRU EXIT-NOSUBCLASS if (SQLCODENOT = 100OR NORMSQ NOT = "02000") then MOVE0TO flag END-IF if (NORMSQ = "02000"AND NORMSQ NOT = SQLSTATE) then DISPLAY"Valid implementation-defined SQLSTATE accepted." END-IF DISPLAY" "
DISPLAY"DECLARE C14733 CURSOR FOR" DISPLAY" SELECT * FROM STAFF66 RIGHT JOIN HU.STAFF" DISPLAY" USING (GRADE, EMPNUM, EMPNAME)" DISPLAY" WHERE EMPNUM > 'E1'" DISPLAY" ORDER BY EMPNUM;" * EXEC SQL DECLARE C14733 CURSOR FOR * SELECT * FROM STAFF66 RIGHT JOIN HU.STAFF * USING (GRADE, EMPNUM, EMPNAME) * WHERE EMPNUM > 'E1' * ORDER BY EMPNUM END-EXEC
MOVE"xxxxxxxxxxxxxxxxxxxx"TO ename MOVE0TO gr MOVE"xxx"TO en MOVE"xxxxxxxxxxxxxxx"TO ct MOVE0TO indic1 DISPLAY"FETCH C14733 INTO :ename, :gr, :en, :sl:indic1,
- " :ct;" * EXEC SQL FETCH C14733 INTO :ename, :gr, :en, :sl:indic1, * :ct; CALL"SUB69"USINGSQLCODE SQLSTATE ename gr en sl
indic1 ct MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"ename should be 'Betty '; its value
- " is '", ename, "'" DISPLAY"gr should be 10; its value is ", gr DISPLAY"en should be 'E2 '; its value is '", en, "'" DISPLAY"indic1 should be -1; its value is ", indic1 DISPLAY"ct should be 'Vienna '; its value is '",
ct, "'" if (en NOT = "E2 "OR indic1 NOT = -1) then MOVE0TO flag END-IF if (ename NOT = "Betty "OR gr NOT = 10) then MOVE0TO flag END-IF if (ct NOT = "Vienna ") then MOVE0TO flag END-IF
MOVE"xxxxxxxxxxxxxxxxxxxx"TO ename MOVE0TO gr MOVE"xxx"TO en MOVE"xxxxxxxxxxxxxxx"TO ct MOVE0TO sl DISPLAY"FETCH C14733 INTO :ename, :gr, :en, :sl:indic1,
- " :ct;" * EXEC SQL FETCH C14733 INTO :ename, :gr, :en, :sl:indic1, * :ct; CALL"SUB70"USINGSQLCODE SQLSTATE ename gr en sl
indic1 ct MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"ename should be 'Carmen '; its value
- " is '", ename, "'" DISPLAY"gr should be 13; its value is ", gr DISPLAY"en should be 'E3 '; its value is '", en, "'" DISPLAY"sl should be 13000; its value is ", sl DISPLAY"indic1 should be 0; its value is ", indic1 DISPLAY"ct should be 'Vienna '; its value is '",
ct, "'" if (en NOT = "E3 "OR indic1 NOT = 0) then MOVE0TO flag END-IF if (ename NOT = "Carmen "OR gr NOT = 13) then MOVE0TO flag END-IF if (ct NOT = "Vienna "OR sl NOT = 13000) then MOVE0TO flag END-IF
MOVE"xxxxxxxxxxxxxxxxxxxx"TO ename MOVE0TO gr MOVE"xxx"TO en MOVE"xxxxxxxxxxxxxxx"TO ct MOVE0TO sl DISPLAY"FETCH C14733 INTO :ename, :gr, :en, :sl:indic1,
- " :ct;" * EXEC SQL FETCH C14733 INTO :ename, :gr, :en, :sl:indic1, * :ct; CALL"SUB71"USINGSQLCODE SQLSTATE ename gr en sl
indic1 ct MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"ename should be 'Don '; its value
- " is '", ename, "'" DISPLAY"gr should be 12; its value is ", gr DISPLAY"en should be 'E4 '; its value is '", en, "'" DISPLAY"sl should be 12000; its value is ", sl DISPLAY"indic1 should be 0; its value is ", indic1 DISPLAY"ct should be 'Deale '; its value is '",
ct, "'" if (en NOT = "E4 "OR indic1 NOT = 0) then MOVE0TO flag END-IF if (ename NOT = "Don "OR gr NOT = 12) then MOVE0TO flag END-IF if (ct NOT = "Deale "OR sl NOT = 12000) then MOVE0TO flag END-IF
MOVE"xxxxxxxxxxxxxxxxxxxx"TO ename MOVE0TO gr MOVE"xxx"TO en MOVE"xxxxxxxxxxxxxxx"TO ct MOVE0TO sl DISPLAY"FETCH C14733 INTO :ename, :gr, :en, :sl:indic1,
- " :ct;" * EXEC SQL FETCH C14733 INTO :ename, :gr, :en, :sl:indic1, * :ct; CALL"SUB72"USINGSQLCODE SQLSTATE ename gr en sl
indic1 ct MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"ename should be 'Ed '; its value
- " is '", ename, "'" DISPLAY"gr should be 13; its value is ", gr DISPLAY"en should be 'E5 '; its value is '", en, "'" DISPLAY"sl should be 13000; its value is ", sl DISPLAY"indic1 should be 0; its value is ", indic1 DISPLAY"ct should be 'Akron '; its value is '",
ct, "'" if (en NOT = "E5 "OR indic1 NOT = 0) then MOVE0TO flag END-IF if (ename NOT = "Ed "OR gr NOT = 13) then MOVE0TO flag END-IF if (ct NOT = "Akron "OR sl NOT = 13000) then MOVE0TO flag END-IF
DISPLAY"FETCH C14733 INTO :ename, :gr, :en, :sl:indic1,
- " :ct;" * EXEC SQL FETCH C14733 INTO :ename, :gr, :en, :sl:indic1, * :ct; CALL"SUB73"USINGSQLCODE SQLSTATE ename gr en sl
indic1 ct MOVESQLCODETO SQL-COD DISPLAY"SQLCODE should be 100; its value is ", SQL-COD DISPLAY"SQLSTATE should be 02000; its value is ", SQLSTATE PERFORM NOSUBCLASS THRU EXIT-NOSUBCLASS if (SQLCODENOT = 100OR NORMSQ NOT = "02000") then MOVE0TO flag END-IF if (NORMSQ = "02000"AND NORMSQ NOT = SQLSTATE) then DISPLAY"Valid implementation-defined SQLSTATE accepted." END-IF DISPLAY" "
DISPLAY"DECLARE C14734 CURSOR FOR" DISPLAY" SELECT * FROM HU.STAFF3 LEFT JOIN STAFF66" DISPLAY" USING (GRADE, EMPNUM)" DISPLAY" WHERE EMPNUM > 'E1'" DISPLAY" ORDER BY EMPNUM ASC;" * EXEC SQL DECLARE C14734 CURSOR FOR * SELECT * FROM HU.STAFF3 LEFT JOIN STAFF66 * USING (GRADE, EMPNUM) * WHERE EMPNUM > 'E1' * ORDER BY EMPNUM ASC END-EXEC
MOVE"xxxxxxxxxxxxxxxxxxxx"TO ename MOVE"xxxxxxxxxxxxxxxxxxxx"TO ename2 MOVE0TO gr MOVE"xxx"TO en MOVE"xxxxxxxxxxxxxxx"TO ct MOVE0TO sl MOVE2TO indic1 MOVE2TO indic2 DISPLAY"FETCH C14734 INTO :en, :gr, :ename, :ct," DISPLAY" :sl:indic1, :ename2:indic2;" * EXEC SQL FETCH C14734 INTO :en, :gr, :ename, :ct, * :sl:indic1, :ename2:indic2; CALL"SUB76"USINGSQLCODE SQLSTATE en gr ename ct sl
indic1 ename2 indic2 MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"en should be 'E2 '; its value is '", en, "'" DISPLAY"gr should be 10; its value is ", gr DISPLAY"ename should be 'Betty '; its value
- " is '", ename, "'" DISPLAY"ct should be 'Vienna '; its value is '",
ct, "'" DISPLAY"indic1 should be -1; its value is ", indic1 DISPLAY"indic2 should be -1; its value is ", indic2 if (en NOT = "E2 "OR gr NOT = 10) then MOVE0TO flag END-IF if (ename NOT = "Betty ") then MOVE0TO flag END-IF if (ct NOT = "Vienna ") then MOVE0TO flag END-IF if (indic1 NOT = -1OR indic2 NOT = -1) then MOVE0TO flag END-IF
MOVE"xxxxxxxxxxxxxxxxxxxx"TO ename MOVE"xxxxxxxxxxxxxxxxxxxx"TO ename2 MOVE0TO gr MOVE"xxx"TO en MOVE"xxxxxxxxxxxxxxx"TO ct MOVE0TO sl MOVE2TO indic1 MOVE2TO indic2 DISPLAY"FETCH C14734 INTO :en, :gr, :ename, :ct," DISPLAY" :sl:indic1, :ename2:indic2;" * EXEC SQL FETCH C14734 INTO :en, :gr, :ename, :ct, * :sl:indic1, :ename2:indic2; CALL"SUB77"USINGSQLCODE SQLSTATE en gr ename ct
sl indic1 ename2 indic2 MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"en should be 'E3 '; its value is '", en, "'" DISPLAY"gr should be 13; its value is ", gr DISPLAY"ename should be 'Carmen '; its value
- " is '", ename, "'" DISPLAY"ct should be 'Vienna '; its value is '",
ct, "'" DISPLAY"indic1 should be 0; its value is ", indic1 DISPLAY"sl should be 13000; its value is ", sl DISPLAY"indic2 should be 0; its value is ", indic2 DISPLAY"ename2 should be 'Carmen '; its value
- " is '", ename2, "'" if (en NOT = "E3 "OR gr NOT = 13) then MOVE0TO flag END-IF if (ename NOT = "Carmen ") then MOVE0TO flag END-IF if (ct NOT = "Vienna ") then MOVE0TO flag END-IF if (indic1 NOT = 0OR indic2 NOT = 0) then MOVE0TO flag END-IF if (sl NOT = 13000OR ename2 NOT = "Carmen
- " ") then MOVE0TO flag END-IF
MOVE"xxxxxxxxxxxxxxxxxxxx"TO ename MOVE"xxxxxxxxxxxxxxxxxxxx"TO ename2 MOVE0TO gr MOVE"xxx"TO en MOVE"xxxxxxxxxxxxxxx"TO ct MOVE0TO sl MOVE2TO indic1 MOVE2TO indic2 DISPLAY"FETCH C14734 INTO :en, :gr, :ename, :ct," DISPLAY" :sl:indic1, :ename2:indic2;" * EXEC SQL FETCH C14734 INTO :en, :gr, :ename, :ct, * :sl:indic1, :ename2:indic2; CALL"SUB78"USINGSQLCODE SQLSTATE en gr ename ct sl
indic1 ename2 indic2 MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"en should be 'E4 '; its value is '", en, "'" DISPLAY"gr should be 12; its value is ", gr DISPLAY"ename should be 'Ali '; its value
- " is '", ename, "'" DISPLAY"ct should be 'Deale '; its value is '",
ct, "'" DISPLAY"indic1 should be 0; its value is ", indic1 DISPLAY"sl should be 12000; its value is ", sl DISPLAY"indic2 should be 0; its value is ", indic2 DISPLAY"ename2 should be 'Don '; its value
- " is '", ename2, "'" if (en NOT = "E4 "OR gr NOT = 12) then MOVE0TO flag END-IF if (ename NOT = "Ali ") then MOVE0TO flag END-IF if (ct NOT = "Deale ") then MOVE0TO flag END-IF if (indic1 NOT = 0OR indic2 NOT = 0) then MOVE0TO flag END-IF if (sl NOT = 12000OR ename2 NOT = "Don
- " ") then MOVE0TO flag END-IF
MOVE"xxxxxxxxxxxxxxxxxxxx"TO ename MOVE"xxxxxxxxxxxxxxxxxxxx"TO ename2 MOVE0TO gr MOVE"xxx"TO en MOVE"xxxxxxxxxxxxxxx"TO ct MOVE0TO sl MOVE2TO indic1 MOVE2TO indic2 DISPLAY"FETCH C14734 INTO :en, :gr, :ename, :ct," DISPLAY" :sl:indic1, :ename2:indic2;" * EXEC SQL FETCH C14734 INTO :en, :gr, :ename, :ct, * :sl:indic1, :ename2:indic2; CALL"SUB79"USINGSQLCODE SQLSTATE en gr ename ct sl
indic1 ename2 indic2 MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"en should be 'E6 '; its value is '", en, "'" DISPLAY"gr should be 13; its value is ", gr DISPLAY"ename should be 'Ed '; its value
- " is '", ename, "'" DISPLAY"ct should be 'Akron '; its value is '",
ct, "'" DISPLAY"indic1 should be -1; its value is ", indic1 DISPLAY"indic2 should be -1; its value is ", indic2 if (en NOT = "E6 "OR gr NOT = 13) then MOVE0TO flag END-IF if (ename NOT = "Ed ") then MOVE0TO flag END-IF if (ct NOT = "Akron ") then MOVE0TO flag END-IF if (indic1 NOT = -1OR indic2 NOT = -1) then MOVE0TO flag END-IF
DISPLAY"FETCH C14734 INTO :en, :gr, :ename, :ct," DISPLAY" :sl:indic1, :ename2:indic2;" * EXEC SQL FETCH C14734 INTO :en, :gr, :ename, :ct, * :sl:indic1, :ename2:indic2; CALL"SUB80"USINGSQLCODE SQLSTATE en gr ename ct sl
indic1 ename2 indic2 MOVESQLCODETO SQL-COD DISPLAY"SQLCODE should be 100; its value is ", SQL-COD DISPLAY"SQLSTATE should be 02000; its value is ", SQLSTATE PERFORM NOSUBCLASS THRU EXIT-NOSUBCLASS if (SQLCODENOT = 100OR NORMSQ NOT = "02000") then MOVE0TO flag END-IF if (NORMSQ = "02000"AND NORMSQ NOT = SQLSTATE) then DISPLAY"Valid implementation-defined SQLSTATE accepted." END-IF DISPLAY" "
*Similar to above, except for explicit names of columns
MOVE"xxxxxxxxxxxxxxxxxxxx"TO ename MOVE"xxxxxxxxxxxxxxxxxxxx"TO ename2 MOVE0TO gr MOVE"xxx"TO en MOVE"xxxxxxxxxxxxxxx"TO ct MOVE0TO sl DISPLAY"SELECT EMPNUM, GRADE, HU.STAFF3.EMPNAME, CITY," DISPLAY" SALARY, STAFF66.EMPNAME" DISPLAY" INTO :en, :gr, :ename, :ct, :sl, :ename2" DISPLAY" FROM HU.STAFF3 LEFT JOIN STAFF66" DISPLAY" USING (GRADE, EMPNUM)" DISPLAY" WHERE EMPNUM = 'E3';" * EXEC SQL SELECT EMPNUM, GRADE, HU.STAFF3.EMPNAME, CITY, * SALARY, STAFF66.EMPNAME * INTO :en, :gr, :ename, :ct, :sl, :ename2 * FROM HU.STAFF3 LEFT JOIN STAFF66 * USING (GRADE, EMPNUM) * WHERE EMPNUM = 'E3'; CALL"SUB82"USINGSQLCODE SQLSTATE en gr ename ct sl ename2 MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"en should be 'E3 '; its value is '", en, "'" DISPLAY"gr should be 13; its value is ", gr DISPLAY"ename should be 'Carmen '; its value
- " is '", ename, "'" DISPLAY"ct should be 'Vienna '; its value is '",
ct, "'" DISPLAY"sl should be 13000; its value is ", sl DISPLAY"ename2 should be 'Carmen '; its value
- " is '", ename2, "'" if (en NOT = "E3 "OR gr NOT = 13) then MOVE0TO flag END-IF if (ename NOT = "Carmen ") then MOVE0TO flag END-IF if (ct NOT = "Vienna ") then MOVE0TO flag END-IF if (sl NOT = 13000OR ename2 NOT = "Carmen
- " ") then MOVE0TO flag END-IF
DISPLAY"DECLARE C14735 CURSOR FOR" DISPLAY" SELECT EMPNUM, GRADE, HU.STAFF3.EMPNAME, CITY," DISPLAY" SALARY, STAFF66.EMPNAME" DISPLAY" FROM HU.STAFF3 LEFT JOIN STAFF66" DISPLAY" USING (GRADE, EMPNUM)" DISPLAY" WHERE EMPNUM = 'E3';" * EXEC SQL DECLARE C14735 CURSOR FOR * SELECT EMPNUM, GRADE, HU.STAFF3.EMPNAME, CITY, * SALARY, STAFF66.EMPNAME * FROM HU.STAFF3 LEFT JOIN STAFF66 * USING (GRADE, EMPNUM) * WHERE EMPNUM = 'E3' END-EXEC
MOVE"xxxxxxxxxxxxxxxxxxxx"TO ename MOVE"xxxxxxxxxxxxxxxxxxxx"TO ename2 MOVE0TO gr MOVE"xxx"TO en MOVE"xxxxxxxxxxxxxxx"TO ct MOVE0TO sl DISPLAY"FETCH C14735 INTO :en, :gr, :ename, :ct, :sl,
- " :ename2;" * EXEC SQL FETCH C14735 INTO :en, :gr, :ename, :ct, :sl, * :ename2; CALL"SUB84"USINGSQLCODE SQLSTATE en gr ename ct sl ename2 MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"en should be 'E3 '; its value is '", en, "'" DISPLAY"gr should be 13; its value is ", gr DISPLAY"ename should be 'Carmen '; its value
- " is '", ename, "'" DISPLAY"ct should be 'Vienna '; its value is '",
ct, "'" DISPLAY"sl should be 13000; its value is ", sl DISPLAY"ename2 should be 'Carmen '; its value
- " is '", ename2, "'" if (en NOT = "E3 "OR gr NOT = 13) then MOVE0TO flag END-IF if (ename NOT = "Carmen ") then MOVE0TO flag END-IF if (ct NOT = "Vienna ") then MOVE0TO flag END-IF if (sl NOT = 13000OR ename2 NOT = "Carmen
- " ") then MOVE0TO flag END-IF
MOVE0TO int1 DISPLAY"SELECT COUNT (*) INTO :int1" DISPLAY" FROM STAFF66 NATURAL RIGHT JOIN HU.PROJ;" * EXEC SQL SELECT COUNT (*) INTO :int1 * FROM STAFF66 NATURAL RIGHT JOIN HU.PROJ; CALL"SUB86"USINGSQLCODE SQLSTATE int1 MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"int1 should be 18; its value is ", int1 if (int1 NOT = 18) then MOVE0TO flag END-IF
*FULL OUTER JOIN of tables with unique data in the joined column
DISPLAY"DECLARE C14736 CURSOR FOR" DISPLAY" SELECT EMPNUM, CITY, SALARY" DISPLAY" FROM HU.STAFF3 LEFT JOIN STAFF66 USING
- " (EMPNUM)" DISPLAY" UNION" DISPLAY" SELECT EMPNUM, CITY, SALARY" DISPLAY" FROM HU.STAFF3 RIGHT JOIN STAFF66 USING
- " (EMPNUM)" DISPLAY" ORDER BY EMPNUM;" * EXEC SQL DECLARE C14736 CURSOR FOR * SELECT EMPNUM, CITY, SALARY * FROM HU.STAFF3 LEFT JOIN STAFF66 USING (EMPNUM) * UNION * SELECT EMPNUM, CITY, SALARY * FROM HU.STAFF3 RIGHT JOIN STAFF66 USING (EMPNUM) * ORDER BY EMPNUM END-EXEC
MOVE"xxx"TO en MOVE"xxxxxxxxxxxxxxx"TO ct MOVE0TO indic1 DISPLAY"FETCH C14736 INTO :en, :ct, :sl:indic1;" * EXEC SQL FETCH C14736 INTO :en, :ct, :sl:indic1; CALL"SUB88"USINGSQLCODE SQLSTATE en ct sl indic1 MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"en should be 'E1 '; its value is '", en, "'" DISPLAY"ct should be 'Deale '; its value is '",
ct, "'" DISPLAY"indic1 should be -1; its value is ", indic1 if (en NOT = "E1 "OR ct NOT = "Deale ") then MOVE0TO flag END-IF if (indic1 NOT = -1) then MOVE0TO flag END-IF
MOVE"xxx"TO en MOVE"xxxxxxxxxxxxxxx"TO ct MOVE0TO indic1 DISPLAY"FETCH C14736 INTO :en, :ct, :sl:indic1;" * EXEC SQL FETCH C14736 INTO :en, :ct, :sl:indic1; CALL"SUB89"USINGSQLCODE SQLSTATE en ct sl indic1 MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"en should be 'E2 '; its value is '", en, "'" DISPLAY"ct should be 'Vienna '; its value is '",
ct, "'" DISPLAY"indic1 should be -1; its value is ", indic1 if (en NOT = "E2 "OR ct NOT = "Vienna ") then MOVE0TO flag END-IF if (indic1 NOT = -1) then MOVE0TO flag END-IF
MOVE"xxx"TO en MOVE"xxxxxxxxxxxxxxx"TO ct MOVE0TO sl COMPUTE indic1 = -1 DISPLAY"FETCH C14736 INTO :en, :ct, :sl:indic1;" * EXEC SQL FETCH C14736 INTO :en, :ct, :sl:indic1; CALL"SUB90"USINGSQLCODE SQLSTATE en ct sl indic1 MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"en should be 'E3 '; its value is '", en, "'" DISPLAY"ct should be 'Vienna '; its value is '",
ct, "'" DISPLAY"sl should be 13000; its value is ", sl DISPLAY"indic1 should be 0; its value is ", indic1 if (en NOT = "E3 "OR ct NOT = "Vienna ") then MOVE0TO flag END-IF if (sl NOT = 13000OR indic1 NOT = 0) then MOVE0TO flag END-IF
MOVE"xxx"TO en MOVE"xxxxxxxxxxxxxxx"TO ct MOVE0TO sl COMPUTE indic1 = -1 DISPLAY"FETCH C14736 INTO :en, :ct, :sl:indic1;" * EXEC SQL FETCH C14736 INTO :en, :ct, :sl:indic1; CALL"SUB91"USINGSQLCODE SQLSTATE en ct sl indic1 MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"en should be 'E4 '; its value is '", en, "'" DISPLAY"ct should be 'Deale '; its value is '",
ct, "'" DISPLAY"sl should be 12000; its value is ", sl DISPLAY"indic1 should be 0; its value is ", indic1 if (en NOT = "E4 "OR ct NOT = "Deale ") then MOVE0TO flag END-IF if (sl NOT = 12000OR indic1 NOT = 0) then MOVE0TO flag END-IF
MOVE"xxx"TO en MOVE"xxxxxxxxxxxxxxx"TO ct MOVE0TO sl MOVE0TO indic1 DISPLAY"FETCH C14736 INTO :en, :ct:indic1, :sl;" * EXEC SQL FETCH C14736 INTO :en, :ct:indic1, :sl; CALL"SUB92"USINGSQLCODE SQLSTATE en ct indic1 sl MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"en should be 'E5 '; its value is '", en, "'" DISPLAY"sl should be 13000; its value is ", sl DISPLAY"indic1 should be -1; its value is ", indic1 if (en NOT = "E5 ") then MOVE0TO flag END-IF if (sl NOT = 13000OR indic1 NOT = -1) then MOVE0TO flag END-IF
MOVE"xxx"TO en MOVE"xxxxxxxxxxxxxxx"TO ct MOVE0TO indic1 DISPLAY"FETCH C14736 INTO :en, :ct, :sl:indic1;" * EXEC SQL FETCH C14736 INTO :en, :ct, :sl:indic1; CALL"SUB93"USINGSQLCODE SQLSTATE en ct sl indic1 MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"en should be 'E6 '; its value is '", en, "'" DISPLAY"ct should be 'Akron '; its value is '",
ct, "'" DISPLAY"indic1 should be -1; its value is ", indic1 if (en NOT = "E6 "OR ct NOT = "Akron ") then MOVE0TO flag END-IF if (indic1 NOT = -1) then MOVE0TO flag END-IF
DISPLAY"FETCH C14736 INTO :en, :ct, :sl:indic1;" * EXEC SQL FETCH C14736 INTO :en, :ct, :sl:indic1; CALL"SUB94"USINGSQLCODE SQLSTATE en ct sl indic1 MOVESQLCODETO SQL-COD DISPLAY"SQLCODE should be 100; its value is ", SQL-COD DISPLAY"SQLSTATE should be 02000; its value is ", SQLSTATE PERFORM NOSUBCLASS THRU EXIT-NOSUBCLASS if (SQLCODENOT = 100OR NORMSQ NOT = "02000") then MOVE0TO flag END-IF if (NORMSQ = "02000"AND NORMSQ NOT = SQLSTATE) then DISPLAY"Valid implementation-defined SQLSTATE accepted." END-IF DISPLAY" "
* EXEC SQL COMMIT WORK; CALL"SUB100"USINGSQLCODE SQLSTATE MOVESQLCODETO SQL-COD ******************** END TEST0842 ******************** **** TESTER MAY CHOOSE TO INSERT CODE FOR errcnt > 0 STOPRUN.
* **** 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 PERFORM NOSUBCLASS THRU EXIT-NOSUBCLASS if (SQLCODENOT = 0OR NORMSQ NOT = "00000") then MOVE0TO flag END-IF if (NORMSQ = "00000"AND NORMSQ NOT = SQLSTATE) 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
MOVE3TO 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 norm2 > 36 if (NORMSQX(norm1) = ALPNUM(norm2)) then 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 GOTO EXIT-NOSUBCLASS END-IF
MOVE4TO norm1 *examining position 4 of char array NORMSQ *valid characters are 0-9, A-Z PERFORMVARYING norm2 FROM1BY1UNTIL norm2 > 36 if (NORMSQX(norm1) = ALPNUM(norm2)) then MOVE"0"TO NORMSQX(norm1) END-IF END-PERFORM
MOVE5TO norm1 *valid characters are 0-9, A-Z *examining position 5 of char array NORMSQ PERFORMVARYING norm2 FROM1BY1UNTIL norm2 > 36 if (NORMSQX(norm1) = ALPNUM(norm2)) then 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.
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.41 Sekunden
(vorverarbeitet am 2026-06-08)
¤
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.