Why not write a new dictionary item?
This can set a flag if FIELD is neither SF456 nor SH456.
Let's call it VALID.FIELD
I would use the following A-correlative
A;IF N(FIELD) = "SF456" THEN "" ELSE IF N(FIELD) = "SH456" THEN "" ELSE "1"
That would work at least in UniData - not sure if UV supports A-correlatives. In a V- or I-type dictionary you may have to use SUBR("OCONVS"...), SUBR("IFS"...) or EXTRACT because it is multi-valued (I am still not that familiar with the syntax with multivalued fields), but in principle that should do the trick.
Then just
SELECT FILE WITH VALID.FIELD

No fancy SELECT, SQL or Basic program required


Brutzman, Bill wrote:
Perhaps a UniBasic program would be workable.

--Bill

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Jeffrey Butera
Sent: Friday, June 20, 2008 11:26 AM
To: [email protected]
Subject: [U2] Friday query logic


I can't get my head around the proper query logic on this Friday.

I have a FILE with mv FIELD containing strings.  I want to query records
where at least one of the FIELD values doesn't begin with "SF..." or "SH...".

To be clear:  I don't want records if any of the following occurs:

FIELD = 'SF123'
FIELD = 'SH456'
FIELD = 'SF123':@VM:'SH456'

but I do want records if any of these occur:

FIELD='PQ789'
FIELD='SF123':@VM:'XY789'
FIELD='SF123':@VM:'SH456':@VM:'GH789'

----------------
I tried

SELECT FILE WITH FIELD UNLIKE "SF...""SH..."
and
SELECT FILE WITH FIELD UNLIKE "SF..." AND FIELD UNLIKE "SH..."

but those include records where FIELD='SF123':@VM:'SH456'. Then I tried
SELECT FILE WITH NO FIELD LIKE "SF...""SH..."
and
SELECT FILE WITH NO FIELD LIKE "SF..." AND NO FIELD LIKE "SH..."

but that throws out records where FIELD='SF123':@VM:'SH456':@VM:'GH789'
which I need to keep. I've tried some others variants using 'EVERY' but to no avail.

So, I'm as a loss short of writing a I-descriptor. Anyone have their logic cap on today?
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to