**************************************************************** * * COMMENT SECTION * * DATE 1995/09/19 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. * * DML157.PCO * WRITTEN BY: David Flater * TRANSLATED AUTOMATICALLY FROM EMBEDDED C BY CHRIS SCHANZLE * * This routine tests Transitional SQL. * * REFERENCES * FIPS PUB 127-2 14.1 Transitional SQL * ANSI SQL-1992 * ****************************************************************
MOVE"FLATER "TO uid CALL"AUTHID"USING uid MOVE"not logged in, not"TO uidx EXECSQLSELECT USER INTO :uidx FROM HU.ECCO END-EXEC MOVESQLCODETO SQL-COD EXECSQLROLLBACK WORK END-EXEC MOVESQLCODETO SQL-COD if (uid NOT = uidx) then DISPLAY"ERROR: User ", uid, " expected. User ", uidx, "
- " connected" STOPRUN END-IF MOVE0TO errcnt
DISPLAY "SQL Test Suite, V6.0, Embedded COBOL, dml157.pco" DISPLAY "59-byte ID" DISPLAY"TEd Version #" *date_time print ACCEPT TO-DAY FROMDATE ACCEPT THE-TIME FROMTIME DISPLAY"Date run YYMMDD: " TO-DAY " at hhmmssff: " THE-TIME
******************** BEGIN TEST0856 ******************* MOVE1TO flag
DISPLAY"FETCH C15711 INTO :pstaid, :pdcp, :pnam," DISPLAY" :platc, :plongc, :pmerid INDICATOR :indic1,
- " :pmllw:indic2," DISPLAY" :pcurr INDICATOR :indic3;" EXECSQL FETCH C15711 INTO :pstaid, :pdcp, :pnam,
:platc, :plongc, :pmerid INDICATOR :indic1,
:pmllw:indic2,
:pcurr INDICATOR :indic3 END-EXEC MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"pstaid should be 670001; its value is ", pstaid if (pstaid NOT = 670001) then MOVE0TO flag END-IF DISPLAY"pdcp should be 0; its value is ", pdcp if (pdcp NOT = 0) then MOVE0TO flag END-IF DISPLAY"pnam should be 'NAHA HARBOR, OKINAWA'; its value
- " is '", pnam, "'" *Do not blank pad this; it's a varchar. if (pnam NOT = "NAHA HARBOR, OKINAWA") then MOVE0TO flag END-IF DISPLAY"platc should be '26 12.5N'; its value is '",
platc, "'" if (platc NOT = "26 12.5N") then MOVE0TO flag END-IF DISPLAY"plongc should be '127 40.1E'; its value is '",
plongc, "'" if (plongc NOT = "127 40.1E") then MOVE0TO flag END-IF DISPLAY"indic1 should be 0; its value is ", indic1 if (indic1 NOT = 0) then MOVE0TO flag END-IF DISPLAY"pmerid should be 9; its value is ", pmerid if (pmerid NOT = 9) then MOVE0TO flag END-IF DISPLAY"indic2 should be 0; its value is ", indic2 if (indic2 NOT = 0) then MOVE0TO flag END-IF DISPLAY"pmllw should be 1.18 +- 0.001; its value is ",
pmllw if (pmllw < 1.179OR pmllw > 1.181) then MOVE0TO flag END-IF DISPLAY"indic3 should be -1; its value is ", indic3 if (indic3 NOT = -1) then MOVE0TO flag END-IF DISPLAY" "
DISPLAY"FETCH C15711 INTO :pstaid, :pdcp, :pnam," DISPLAY" :platc, :plongc, :pmerid INDICATOR :indic1,
- " :pmllw:indic2," DISPLAY" :pcurr INDICATOR :indic3;" EXECSQL FETCH C15711 INTO :pstaid, :pdcp, :pnam,
:platc, :plongc, :pmerid INDICATOR :indic1,
:pmllw:indic2,
:pcurr INDICATOR :indic3 END-EXEC MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"pstaid should be 1495000; its value is ", pstaid if (pstaid NOT = 1495000) then MOVE0TO flag END-IF DISPLAY"pdcp should be 1; its value is ", pdcp if (pdcp NOT = 1) then MOVE0TO flag END-IF DISPLAY"pnam should be 'ESPERANZA, ANTARCTICA'; its value
- " is '", pnam, "'" *Do not blank pad this; it's a varchar. if (pnam NOT = "ESPERANZA, ANTARCTICA") then MOVE0TO flag END-IF DISPLAY"platc should be '63 23.7S'; its value is '",
platc, "'" if (platc NOT = "63 23.7S") then MOVE0TO flag END-IF DISPLAY"plongc should be '56 59.7W'; its value is '",
plongc, "'" if (plongc NOT = "56 59.7W") then MOVE0TO flag END-IF DISPLAY"indic1 should be -1; its value is ", indic1 if (indic1 NOT = -1) then MOVE0TO flag END-IF DISPLAY"indic2 should be -1; its value is ", indic2 if (indic2 NOT = -1) then MOVE0TO flag END-IF DISPLAY"indic3 should be -1; its value is ", indic3 if (indic3 NOT = -1) then MOVE0TO flag END-IF DISPLAY" "
DISPLAY"FETCH C15711 INTO :pstaid, :pdcp, :pnam," DISPLAY" :platc, :plongc, :pmerid INDICATOR :indic1,
- " :pmllw:indic2," DISPLAY" :pcurr INDICATOR :indic3;" EXECSQL FETCH C15711 INTO :pstaid, :pdcp, :pnam,
:platc, :plongc, :pmerid INDICATOR :indic1,
:pmllw:indic2,
:pcurr INDICATOR :indic3 END-EXEC MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"pstaid should be 1495000; its value is ", pstaid if (pstaid NOT = 1495000) then MOVE0TO flag END-IF DISPLAY"pdcp should be 2; its value is ", pdcp if (pdcp NOT = 2) then MOVE0TO flag END-IF DISPLAY"pnam should be 'ESPERANZA, ANTARCTICA'; its value
- " is '", pnam, "'" *Do not blank pad this; it's a varchar. if (pnam NOT = "ESPERANZA, ANTARCTICA") then MOVE0TO flag END-IF DISPLAY"platc should be '63 23.7S'; its value is '",
platc, "'" if (platc NOT = "63 23.7S") then MOVE0TO flag END-IF DISPLAY"plongc should be '56 59.7W'; its value is '",
plongc, "'" if (plongc NOT = "56 59.7W") then MOVE0TO flag END-IF DISPLAY"indic1 should be -1; its value is ", indic1 if (indic1 NOT = -1) then MOVE0TO flag END-IF DISPLAY"indic2 should be -1; its value is ", indic2 if (indic2 NOT = -1) then MOVE0TO flag END-IF DISPLAY"indic3 should be -1; its value is ", indic3 if (indic3 NOT = -1) then MOVE0TO flag END-IF DISPLAY" "
DISPLAY"FETCH C15711 INTO :pstaid, :pdcp, :pnam," DISPLAY" :platc, :plongc, :pmerid INDICATOR :indic1,
- " :pmllw:indic2," DISPLAY" :pcurr INDICATOR :indic3;" EXECSQL FETCH C15711 INTO :pstaid, :pdcp, :pnam,
:platc, :plongc, :pmerid INDICATOR :indic1,
:pmllw:indic2,
:pcurr INDICATOR :indic3 END-EXEC MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"pstaid should be 9414290; its value is ", pstaid if (pstaid NOT = 9414290) then MOVE0TO flag END-IF DISPLAY"pdcp should be 0; its value is ", pdcp if (pdcp NOT = 0) then MOVE0TO flag END-IF DISPLAY"pnam should be 'SAN FRANCISCO, SAN FRANCISCO
- " BAY';" DISPLAY" its value is '", pnam, "'" *Do not blank pad this; it's a varchar. if (pnam NOT = "SAN FRANCISCO, SAN FRANCISCO BAY") then MOVE0TO flag END-IF DISPLAY"platc should be '37 48.4N'; its value is '",
platc, "'" if (platc NOT = "37 48.4N") then MOVE0TO flag END-IF DISPLAY"plongc should be '122 27.9W'; its value is '",
plongc, "'" if (plongc NOT = "122 27.9W") then MOVE0TO flag END-IF DISPLAY"indic1 should be 0; its value is ", indic1 if (indic1 NOT = 0) then MOVE0TO flag END-IF DISPLAY"pmerid should be -8; its value is ", pmerid if (pmerid NOT = -8) then MOVE0TO flag END-IF DISPLAY"indic2 should be 0; its value is ", indic2 if (indic2 NOT = 0) then MOVE0TO flag END-IF DISPLAY"pmllw should be 3.13 +- 0.001; its value is ",
pmllw if (pmllw < 3.129OR pmllw > 3.131) then MOVE0TO flag END-IF DISPLAY"indic3 should be 0; its value is ", indic3 if (indic3 NOT = 0) then MOVE0TO flag END-IF DISPLAY"pcurr should be -0.2 +- 0.001; its value is ",
pcurr if (pcurr < -0.201OR pcurr > -0.199) then MOVE0TO flag END-IF DISPLAY" "
DISPLAY"FETCH C15711 INTO :pstaid, :pdcp, :pnam," DISPLAY" :platc, :plongc, :pmerid INDICATOR :indic1,
- " :pmllw:indic2," DISPLAY" :pcurr INDICATOR :indic3;" EXECSQL FETCH C15711 INTO :pstaid, :pdcp, :pnam,
:platc, :plongc, :pmerid INDICATOR :indic1,
:pmllw:indic2,
:pcurr INDICATOR :indic3 END-EXEC MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"pstaid should be 9452210; its value is ", pstaid if (pstaid NOT = 9452210) then MOVE0TO flag END-IF DISPLAY"pdcp should be 0; its value is ", pdcp if (pdcp NOT = 0) then MOVE0TO flag END-IF DISPLAY"pnam should be 'JUNEAU, GASTINEAU CHANNEL,
- " STEPHENS';" DISPLAY" its value is '", pnam, "'" *Do not blank pad this; it's a varchar. if (pnam NOT = "JUNEAU, GASTINEAU CHANNEL, STEPHENS") then MOVE0TO flag END-IF DISPLAY"platc should be '58 17.9N'; its value is '",
platc, "'" if (platc NOT = "58 17.9N") then MOVE0TO flag END-IF DISPLAY"plongc should be '134 24.7W'; its value is '",
plongc, "'" if (plongc NOT = "134 24.7W") then MOVE0TO flag END-IF DISPLAY"indic1 should be 0; its value is ", indic1 if (indic1 NOT = 0) then MOVE0TO flag END-IF DISPLAY"pmerid should be -9; its value is ", pmerid if (pmerid NOT = -9) then MOVE0TO flag END-IF DISPLAY"indic2 should be 0; its value is ", indic2 if (indic2 NOT = 0) then MOVE0TO flag END-IF DISPLAY"pmllw should be 5.62 +- 0.001; its value is ",
pmllw if (pmllw < 5.619OR pmllw > 5.621) then MOVE0TO flag END-IF DISPLAY"indic3 should be -1; its value is ", indic3 if (indic3 NOT = -1) then MOVE0TO flag END-IF DISPLAY" "
DISPLAY"FETCH C15711 INTO :pstaid, :pdcp, :pnam," DISPLAY" :platc, :plongc, :pmerid INDICATOR :indic1,
- " :pmllw:indic2," DISPLAY" :pcurr INDICATOR :indic3;" EXECSQL FETCH C15711 INTO :pstaid, :pdcp, :pnam,
:platc, :plongc, :pmerid INDICATOR :indic1,
:pmllw:indic2,
:pcurr INDICATOR :indic3 END-EXEC MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"pstaid should be 9962420; its value is ", pstaid if (pstaid NOT = 9962420) then MOVE0TO flag END-IF DISPLAY"pdcp should be 1; its value is ", pdcp if (pdcp NOT = 1) then MOVE0TO flag END-IF DISPLAY"pnam should be 'EASTER ISLAND, HANGA PIKO
- " HARBOR';" DISPLAY" its value is '", pnam, "'" *Do not blank pad this; it's a varchar. if (pnam NOT = "EASTER ISLAND, HANGA PIKO HARBOR") then MOVE0TO flag END-IF DISPLAY"platc should be '27 9.0S'; its value is '",
platc, "'" if (platc NOT = "27 9.0S") then MOVE0TO flag END-IF DISPLAY"plongc should be '109 26.9W'; its value is '",
plongc, "'" if (plongc NOT = "109 26.9W") then MOVE0TO flag END-IF DISPLAY"indic1 should be 0; its value is ", indic1 if (indic1 NOT = 0) then MOVE0TO flag END-IF DISPLAY"pmerid should be -7; its value is ", pmerid if (pmerid NOT = -7) then MOVE0TO flag END-IF DISPLAY"indic2 should be 0; its value is ", indic2 if (indic2 NOT = 0) then MOVE0TO flag END-IF DISPLAY"pmllw should be 1.5 +- 0.001; its value is ",
pmllw if (pmllw < 1.499OR pmllw > 1.501) then MOVE0TO flag END-IF DISPLAY"indic3 should be -1; its value is ", indic3 if (indic3 NOT = -1) then MOVE0TO flag END-IF DISPLAY" "
DISPLAY"FETCH C15712 INTO :pstaid, :pdcp, :pnam," DISPLAY" :platf, :plongf, :pmerid INDICATOR :indic1,
- " :pmllw:indic2," DISPLAY" :pcurr INDICATOR :indic3;" EXECSQL FETCH C15712 INTO :pstaid, :pdcp, :pnam,
:platf, :plongf, :pmerid INDICATOR :indic1,
:pmllw:indic2,
:pcurr INDICATOR :indic3 END-EXEC MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"pstaid should be 670001; its value is ", pstaid if (pstaid NOT = 670001) then MOVE0TO flag END-IF DISPLAY"pdcp should be 0; its value is ", pdcp if (pdcp NOT = 0) then MOVE0TO flag END-IF DISPLAY"pnam should be 'NAHA HARBOR, OKINAWA'; its value
- " is '", pnam, "'" *Do not blank pad this; it's a varchar. if (pnam NOT = "NAHA HARBOR, OKINAWA") then MOVE0TO flag END-IF DISPLAY"platf should be 26.208 +- 0.001; its value is ",
platf if (platf < 26.207OR platf > 26.209) then MOVE0TO flag END-IF DISPLAY"plongf should be 127.668 +- 0.001; its value is ",
plongf if (plongf < 127.667OR plongf > 127.669) then MOVE0TO flag END-IF DISPLAY"indic1 should be 0; its value is ", indic1 if (indic1 NOT = 0) then MOVE0TO flag END-IF DISPLAY"pmerid should be 9; its value is ", pmerid if (pmerid NOT = 9) then MOVE0TO flag END-IF DISPLAY"indic2 should be 0; its value is ", indic2 if (indic2 NOT = 0) then MOVE0TO flag END-IF DISPLAY"pmllw should be 1.18 +- 0.001; its value is ",
pmllw if (pmllw < 1.179OR pmllw > 1.181) then MOVE0TO flag END-IF DISPLAY"indic3 should be -1; its value is ", indic3 if (indic3 NOT = -1) then MOVE0TO flag END-IF DISPLAY" "
DISPLAY"FETCH C15712 INTO :pstaid, :pdcp, :pnam," DISPLAY" :platf, :plongf, :pmerid INDICATOR :indic1,
- " :pmllw:indic2," DISPLAY" :pcurr INDICATOR :indic3;" EXECSQL FETCH C15712 INTO :pstaid, :pdcp, :pnam,
:platf, :plongf, :pmerid INDICATOR :indic1,
:pmllw:indic2,
:pcurr INDICATOR :indic3 END-EXEC MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"pstaid should be 1495000; its value is ", pstaid if (pstaid NOT = 1495000) then MOVE0TO flag END-IF DISPLAY"pdcp should be 1; its value is ", pdcp if (pdcp NOT = 1) then MOVE0TO flag END-IF DISPLAY"pnam should be 'ESPERANZA, ANTARCTICA'; its value
- " is '", pnam, "'" *Do not blank pad this; it's a varchar. if (pnam NOT = "ESPERANZA, ANTARCTICA") then MOVE0TO flag END-IF DISPLAY"platf should be -63.395 +- 0.001; its value is ",
platf if (platf < -63.396OR platf > -63.394) then MOVE0TO flag END-IF DISPLAY"plongf should be -56.995 +- 0.001; its value is ",
plongf if (plongf < -56.996OR plongf > -56.994) then MOVE0TO flag END-IF DISPLAY"indic1 should be -1; its value is ", indic1 if (indic1 NOT = -1) then MOVE0TO flag END-IF DISPLAY"indic2 should be -1; its value is ", indic2 if (indic2 NOT = -1) then MOVE0TO flag END-IF DISPLAY"indic3 should be -1; its value is ", indic3 if (indic3 NOT = -1) then MOVE0TO flag END-IF DISPLAY" "
DISPLAY"FETCH C15712 INTO :pstaid, :pdcp, :pnam," DISPLAY" :platf, :plongf, :pmerid INDICATOR :indic1,
- " :pmllw:indic2," DISPLAY" :pcurr INDICATOR :indic3;" EXECSQL FETCH C15712 INTO :pstaid, :pdcp, :pnam,
:platf, :plongf, :pmerid INDICATOR :indic1,
:pmllw:indic2,
:pcurr INDICATOR :indic3 END-EXEC MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"pstaid should be 1495000; its value is ", pstaid if (pstaid NOT = 1495000) then MOVE0TO flag END-IF DISPLAY"pdcp should be 2; its value is ", pdcp if (pdcp NOT = 2) then MOVE0TO flag END-IF DISPLAY"pnam should be 'ESPERANZA, ANTARCTICA'; its value
- " is '", pnam, "'" *Do not blank pad this; it's a varchar. if (pnam NOT = "ESPERANZA, ANTARCTICA") then MOVE0TO flag END-IF DISPLAY"platf should be -63.395 +- 0.001; its value is ",
platf if (platf < -63.396OR platf > -63.394) then MOVE0TO flag END-IF DISPLAY"plongf should be -56.995 +- 0.001; its value is ",
plongf if (plongf < -56.996OR plongf > -56.994) then MOVE0TO flag END-IF DISPLAY"indic1 should be -1; its value is ", indic1 if (indic1 NOT = -1) then MOVE0TO flag END-IF DISPLAY"indic2 should be -1; its value is ", indic2 if (indic2 NOT = -1) then MOVE0TO flag END-IF DISPLAY"indic3 should be -1; its value is ", indic3 if (indic3 NOT = -1) then MOVE0TO flag END-IF DISPLAY" "
DISPLAY"FETCH C15712 INTO :pstaid, :pdcp, :pnam," DISPLAY" :platf, :plongf, :pmerid INDICATOR :indic1,
- " :pmllw:indic2," DISPLAY" :pcurr INDICATOR :indic3;" EXECSQL FETCH C15712 INTO :pstaid, :pdcp, :pnam,
:platf, :plongf, :pmerid INDICATOR :indic1,
:pmllw:indic2,
:pcurr INDICATOR :indic3 END-EXEC MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"pstaid should be 9414290; its value is ", pstaid if (pstaid NOT = 9414290) then MOVE0TO flag END-IF DISPLAY"pdcp should be 0; its value is ", pdcp if (pdcp NOT = 0) then MOVE0TO flag END-IF DISPLAY"pnam should be 'SAN FRANCISCO, SAN FRANCISCO
- " BAY';" DISPLAY" its value is '", pnam, "'" *Do not blank pad this; it's a varchar. if (pnam NOT = "SAN FRANCISCO, SAN FRANCISCO BAY") then MOVE0TO flag END-IF DISPLAY"platf should be 37.807 +- 0.001; its value is ",
platf if (platf < 37.806OR platf > 37.808) then MOVE0TO flag END-IF DISPLAY"plongf should be -122.465 +- 0.001; its value is
- " ", plongf if (plongf < -122.466OR plongf > -122.464) then MOVE0TO flag END-IF DISPLAY"indic1 should be 0; its value is ", indic1 if (indic1 NOT = 0) then MOVE0TO flag END-IF DISPLAY"pmerid should be -8; its value is ", pmerid if (pmerid NOT = -8) then MOVE0TO flag END-IF DISPLAY"indic2 should be 0; its value is ", indic2 if (indic2 NOT = 0) then MOVE0TO flag END-IF DISPLAY"pmllw should be 3.13 +- 0.001; its value is ",
pmllw if (pmllw < 3.129OR pmllw > 3.131) then MOVE0TO flag END-IF DISPLAY"indic3 should be 0; its value is ", indic3 if (indic3 NOT = 0) then MOVE0TO flag END-IF DISPLAY"pcurr should be -0.2 +- 0.001; its value is ",
pcurr if (pcurr < -0.201OR pcurr > -0.199) then MOVE0TO flag END-IF DISPLAY" "
DISPLAY"FETCH C15712 INTO :pstaid, :pdcp, :pnam," DISPLAY" :platf, :plongf, :pmerid INDICATOR :indic1,
- " :pmllw:indic2," DISPLAY" :pcurr INDICATOR :indic3;" EXECSQL FETCH C15712 INTO :pstaid, :pdcp, :pnam,
:platf, :plongf, :pmerid INDICATOR :indic1,
:pmllw:indic2,
:pcurr INDICATOR :indic3 END-EXEC MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"pstaid should be 9452210; its value is ", pstaid if (pstaid NOT = 9452210) then MOVE0TO flag END-IF DISPLAY"pdcp should be 0; its value is ", pdcp if (pdcp NOT = 0) then MOVE0TO flag END-IF DISPLAY"pnam should be 'JUNEAU, GASTINEAU CHANNEL,
- " STEPHENS';" DISPLAY" its value is '", pnam, "'" *Do not blank pad this; it's a varchar. if (pnam NOT = "JUNEAU, GASTINEAU CHANNEL, STEPHENS") then MOVE0TO flag END-IF DISPLAY"platf should be 58.298 +- 0.001; its value is ",
platf if (platf < 58.297OR platf > 58.299) then MOVE0TO flag END-IF DISPLAY"plongf should be -134.412 +- 0.001; its value is
- " ", plongf if (plongf < -134.413OR plongf > -134.411) then MOVE0TO flag END-IF DISPLAY"indic1 should be 0; its value is ", indic1 if (indic1 NOT = 0) then MOVE0TO flag END-IF DISPLAY"pmerid should be -9; its value is ", pmerid if (pmerid NOT = -9) then MOVE0TO flag END-IF DISPLAY"indic2 should be 0; its value is ", indic2 if (indic2 NOT = 0) then MOVE0TO flag END-IF DISPLAY"pmllw should be 5.62 +- 0.001; its value is ",
pmllw if (pmllw < 5.619OR pmllw > 5.621) then MOVE0TO flag END-IF DISPLAY"indic3 should be -1; its value is ", indic3 if (indic3 NOT = -1) then MOVE0TO flag END-IF DISPLAY" "
DISPLAY"FETCH C15712 INTO :pstaid, :pdcp, :pnam," DISPLAY" :platf, :plongf, :pmerid INDICATOR :indic1,
- " :pmllw:indic2," DISPLAY" :pcurr INDICATOR :indic3;" EXECSQL FETCH C15712 INTO :pstaid, :pdcp, :pnam,
:platf, :plongf, :pmerid INDICATOR :indic1,
:pmllw:indic2,
:pcurr INDICATOR :indic3 END-EXEC MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"pstaid should be 9962420; its value is ", pstaid if (pstaid NOT = 9962420) then MOVE0TO flag END-IF DISPLAY"pdcp should be 1; its value is ", pdcp if (pdcp NOT = 1) then MOVE0TO flag END-IF DISPLAY"pnam should be 'EASTER ISLAND, HANGA PIKO
- " HARBOR';" DISPLAY" its value is '", pnam, "'" *Do not blank pad this; it's a varchar. if (pnam NOT = "EASTER ISLAND, HANGA PIKO HARBOR") then MOVE0TO flag END-IF DISPLAY"platf should be -27.15 +- 0.001; its value is ",
platf if (platf < -27.151OR platf > -27.149) then MOVE0TO flag END-IF DISPLAY"plongf should be -109.448 +- 0.001; its value is
- " ", plongf if (plongf < -109.449OR plongf > -109.447) then MOVE0TO flag END-IF DISPLAY"indic1 should be 0; its value is ", indic1 if (indic1 NOT = 0) then MOVE0TO flag END-IF DISPLAY"pmerid should be -7; its value is ", pmerid if (pmerid NOT = -7) then MOVE0TO flag END-IF DISPLAY"indic2 should be 0; its value is ", indic2 if (indic2 NOT = 0) then MOVE0TO flag END-IF DISPLAY"pmllw should be 1.5 +- 0.001; its value is ",
pmllw if (pmllw < 1.499OR pmllw > 1.501) then MOVE0TO flag END-IF DISPLAY"indic3 should be -1; its value is ", indic3 if (indic3 NOT = -1) then MOVE0TO flag END-IF DISPLAY" "
EXECSQLCOMMIT WORK END-EXEC MOVESQLCODETO SQL-COD ******************** END TEST0856 ******************** **** 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
.
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.