Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Andrzejek on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MIMS-SQL - NOT LIKE not working

Status
Not open for further replies.

colinh

Programmer
Jun 11, 2001
10
AU
The following MIMS-SQL code to extract records from the MSF010 table:


MOVE 'PHYL' TO W80-S-010-TABLE-TYPE.
MOVE '%DO NOT USE%' TO W80-S-010-TABLE-DESC.

* Declare cursors for MSF010
EXEC MIMS-SQL
DECLARE (MSF01001)
OPEN
CURSOR-FOR
SELECT (*)
FROM (MSF010)
WHERE (TABLE-TYPE = :W80-S-010-TABLE-TYPE
AND TABLE-DESC
NOT LIKE :W80-S-010-TABLE-DESC)
ORDER-BY (PIX)
END-EXEC.

PERFORM C110-EXTRACT-LOCATIONS
UNTIL W10-EOF-MSF010.

:

C110-EXTRACT-LOCATIONS SECTION.
:
:

* Fetch MSF010
EXEC MIMS-SQL
FETCH (MSF01001)
OPEN-ON-FIRST
CLOSE-ON-LAST
INTO (MSF010-1-RECORD)
WHEN (NOT-FOUND,
MOVE 'Y' TO W10-EOF-MSF010-SW)
WHEN (NOT-FOUND,GOTO,C110-EXIT)
END-EXEC.


The NOT LIKE in the DECLARE doesn't seem to work. when I run a TRACE it shows it actually bring back ALL the records with "DO NOT USE" in the description.


T Paragraph = C110
T MIMS-SQL Request: FETCH (MSF01001)
T INTO (MSF010-1-RECORD)
T Paragraph = PD-MSQL-571-2-ENTER
T DB 571 0 Z,FETCH MSQL-MSF01001
T Paragraph = PD-MSQL-571-2-FOUND
T Paragraph = PD-MSQL-571-2-EXIT
T MIMS-SQL Result:
T MSF010-1-TABLE-TYPE=PHYL
T MSF010-1-TABLE-CODE=***
T MSF010-1-TABLE-DESC=----DO NOT USE-GLOBAL
T MSF010-1-ASSOC-REC=AU 0000 0000
T MIMS-SQL Request: COMPLETED.
T Paragraph = C110-ASSEMBLE-RECORD
T Paragraph = C110-WRITE-RECORD

Am I using the correct syntax or would it be a bug in the macros ?

regards
Colin

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top