×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

MIMS-SQL - NOT LIKE not working

MIMS-SQL - NOT LIKE not working

MIMS-SQL - NOT LIKE not working

(OP)
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

 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close