Suppose you are discontinuing a product range and need to know how many of your customers are likely to be affected by the decision..........this is how I tackle it.
I populate a select list with the product codes or "strings" I am looking for, and then run it against the file I am searching as follows: 1) edit the list RAY.LOOKUP.LIST (with hundreds of strings) or simply save the list if you can obtain them elsewhere. 2) set up an I-type to read the list into the @RECORD buffer. (Incidentally, I can't be bothered to waste half my life typing &SAVEDLISTS& so I use an alias called "TEMP", ). RAY.LOOKUP.LIST: TRANS(TEMP,"RAY.LOOKUP.LIST",@RECORD,"X") 3) Set up an I-type which uses the "Index" verb - this also tells you the position, or Zero if it is not found. RAY.INLIST.CHECK: IF INDEX(RAY.LOOKUP.LIST,PROD.CODE,1) = 0 THEN "N" ELSE "Y" 4) run the query "Select Contract with Ray.Inlist.Check = "y" This will return a list of contracts whose Product code matches one of the entries in the saved list "Ray.Lookup.List". Granted, you have to set up one dictionary "pair" for every query of this type, but in the last 12 years I have only amassed 4 pairs but when you need them they are worth the effort. ps I like to look in on the list once in a while, sadly U2 is no longer our mainstream product (SQL). Keep buzzing! Ray Jones, PHS Group, UK ___________________________________________________________ Tiscali Broadband from 14.99 with free setup! http://www.tiscali.co.uk/products/broadband/ ------- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/