RE: [U2] [UD] Select on an attribute

2005-07-25 Thread Noah Hart
Great!  That is exactly what I needed. 

I forgot about the INTERSECTION option.

Noah 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Jim Bullock
Sent: Monday, July 25, 2005 8:18 AM
To: u2-users@listserver.u2ug.org
Subject: Re: [U2] [UD] Select on an attribute

(If BLORP is your savedlist from File1) GET.LIST BLORP TO 1 SELECT
FILE2 SAVING FILE1_ID TO 2 MERGE.LIST 1 INTERSECTION 2 TO 3 SAVE.LIST
BLAH FROM 3

BLAH will contain the IDs you want, if I understand your question
correctly.)


--- Noah Hart [EMAIL PROTECTED] wrote:

 Select question:
 
 Assume that I have 2 files, such as customer and invoice
 
 File1: has 1 attribute, ID
 File2: has 2 attributes, ID and FILE1_ID
 
 I have a savedlist with ID numbers from file1.
 
 I want to select all records in file2 which have FILE1_ID matching the

 savedlist I already have.
 
 Is this possible?
 
 Thank you,
 
 Noah
 ---
 u2-users mailing list
 u2-users@listserver.u2ug.org
 To unsubscribe please visit http://listserver.u2ug.org/
 


...a livable wage is a moral value. Affordable health care is a moral
value. A decent education is a moral value. A common sense foreign
policy is a moral value. A healthy environment is a moral value. The
feeling of community that comes from full participation in our democracy
is a moral value. It is a moral value to make sure that we do not saddle
our children and grandchildren with our debt.

-Howard Dean

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] [UD] Select on an attribute

2005-07-25 Thread Shawn Waldie
I could write a subr to fetch these, but I don't know how to do it with
uniquery only. I think Noah is saying that he wants to...
SELECT all File2 items if FILE1_ID can be found in the savedlist
containing the IDs from File1.

In this case, won't BLAH still contain IDs from File1?

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of Jim Bullock
 Sent: Monday, July 25, 2005 10:18 AM
 To: u2-users@listserver.u2ug.org
 Subject: Re: [U2] [UD] Select on an attribute
 
 
 (If BLORP is your savedlist from File1)
 GET.LIST BLORP TO 1
 SELECT FILE2 SAVING FILE1_ID TO 2
 MERGE.LIST 1 INTERSECTION 2 TO 3
 SAVE.LIST BLAH FROM 3
 
 BLAH will contain the IDs you want, if I understand your 
 question correctly.)
 
 
 --- Noah Hart [EMAIL PROTECTED] wrote:
 
  Select question:
  
  Assume that I have 2 files, such as customer and invoice
  
  File1: has 1 attribute, ID
  File2: has 2 attributes, ID and FILE1_ID
  
  I have a savedlist with ID numbers from file1.
  
  I want to select all records in file2 which have FILE1_ID 
 matching the 
  savedlist I already have.
  
  Is this possible?
  
  Thank you,
  
  Noah
  ---
  u2-users mailing list
  u2-users@listserver.u2ug.org
  To unsubscribe please visit http://listserver.u2ug.org/
  
 
 
 ...a livable wage is a moral value. Affordable health care 
 is a moral value. A decent education is a moral value. A 
 common sense foreign policy is a moral value. A healthy 
 environment is a moral value. The feeling of community that 
 comes from full participation in our democracy is a moral 
 value. It is a moral value to make sure that we do not saddle 
 our children and grandchildren with our debt.
 
 -Howard Dean
 
 __
 Do You Yahoo!?
 Tired of spam?  Yahoo! Mail has the best spam protection around 
 http://mail.yahoo.com 
 ---
 u2-users mailing list
 u2-users@listserver.u2ug.org
 To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] [UD] Select on an attribute

2005-07-25 Thread Stevenson, Charles
Noah,
Not directly, but *if* File2 is indexed by its FILE1_ID attribute there
are a couple ways.

 Assume that I have 2 files, such as customer and invoice 
 
 File1: has 1 attribute, ID
 File2: has 2 attributes, ID and FILE1_ID
 
 I have a savedlist with ID numbers from file1.
 
 I want to select all records in file2 which have FILE1_ID 
 matching the savedlist I already have.
 
 Is this possible?

1.  In basic, something like:

   OPEN 'File2' to F2.FVAR
   GETLIST [list of File1 IDs]
   F2ID.LIST = ''
   LOOP WHILE READNEXT F1.ID
  SELECTINDEX 'FILE1_ID', F1.ID FROM F2.FVAR TO 10
  READLIST SUBLIST FROM 10 THEN F2ID.LIST-1 = SUBLIST
   REPEAT
Now F2ID.LIST has what you want.

I'll leave it to you to come up with variations on the theme that suits
you.
My own generic solution is a utility XSELECT verb (with Keep active
flag in VOC4)  which takes an active select list of indexed values and
generates an active list of corresponding primary ids.
In this case:
   GET.LIST  [list of File1 IDs]
   XSELECT File2 FILE1_ID

I wish UV had that verb out of the box.


2. QSELECT,  if 1st you set up a  voc pointer to the normally hidden
type-25 I_File2/INDEX.nnn file (let's call it FILE1.FIE2.IDX in the VOC)
:

   GET.LIST [list of File1 IDs]
   QSELECT FILE1.FILE2.IDX


Chuck Stevenson
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] [UD] Select on an attribute

2005-07-25 Thread George Gallen
My thought on this would be to do the following:

1. EDIT-LIST list1
2. add xx at the end (this will force a @am to the end of your last select 
list entry)
3. put the following DICT entry in the second file call it MULTIMATCH,
   I
   TRANS(SAVEDLISTS,listname,-1,'X') ; IF INDEX(@1,ATTR2:@vm,1)=0 THEN  
ELSE Y

4. SELECT FILE2 WITH MULTIMATCH=Y

Of course, you would need to do this for each savedlist you pull from list1
and...I'm not sure if that I-desc will work in Unidata.

George

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Noah Hart
Sent: Monday, July 25, 2005 12:47 PM
To: u2-users@listserver.u2ug.org
Subject: RE: [U2] [UD] Select on an attribute


Sharyl,

That works great if I want all the matches.  My specific problem (which
I was not clear on before) is that I will only have a small number of ID
in my save list.

For example:

SELECT ALL CUSTOMERS in CALIFORNIA
SAVE-LIST CACUST

then I want to say

PSEUDO CODE
SELECT ALL INVOICES WITH CUSTOMER IN SAVE-LIST CACUST

Thanks,

Noah

-Original Message-
From: Sharyl Lindsay [mailto:[EMAIL PROTECTED] 
Sent: Monday, July 25, 2005 8:22 AM
To: Noah Hart
Subject: RE: [U2] [UD] Select on an attribute

Hi Noah,

If I'm understanding you correctly, I'd do the following:

QSELECT FILE2 (1
SAVE-LIST xxLISTNAME

GET-LIST xxLISTNAME
SELECT FILE1


This will give you all the items in FILE1 that have the same value as
attribute two of FILE2.



Sharyl 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Noah Hart
Sent: Monday, July 25, 2005 7:47 AM
To: u2-users@listserver.u2ug.org
Subject: [U2] [UD] Select on an attribute

Select question:

Assume that I have 2 files, such as customer and invoice 

File1: has 1 attribute, ID
File2: has 2 attributes, ID and FILE1_ID

I have a savedlist with ID numbers from file1.

I want to select all records in file2 which have FILE1_ID matching the
savedlist I already have.

Is this possible?

Thank you,

Noah
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] [UD] Select on an attribute

2005-07-25 Thread George Gallen
If you changed
TRANS(SAVEDLISTS,listname,-1,'X') ; IF INDEX(@1,ATTR2:@vm,1)=0 THEN  ELSE 
Y
to
TRANS(SAVEDLISTS,listname,-1,'X') ; IF INDEX(@1:@vm,ATTR2:@vm,1)=0 THEN  
ELSE Y
   you could elminate step 1 and 2, but you will still need to edit the DICT 
entry
   each time to put in the listname, unless you make it a name that you always 
use
   when you save the list.

George

-Original Message-
From: George Gallen 
Sent: Monday, July 25, 2005 1:38 PM
To: 'u2-users@listserver.u2ug.org'
Subject: RE: [U2] [UD] Select on an attribute


My thought on this would be to do the following:

1. EDIT-LIST list1
2. add xx at the end (this will force a @am to the end of your last select 
list entry)
3. put the following DICT entry in the second file call it MULTIMATCH,
   I
   TRANS(SAVEDLISTS,listname,-1,'X') ; IF INDEX(@1,ATTR2:@vm,1)=0 THEN  
ELSE Y

4. SELECT FILE2 WITH MULTIMATCH=Y

Of course, you would need to do this for each savedlist you pull from list1
and...I'm not sure if that I-desc will work in Unidata.

George
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] [UD] Select on an attribute

2005-07-25 Thread Stevenson, Charles
I thought you wanted a list of File2 IDs.
Won't the MERGE.LIST INTERSECTION give you a list of File1 IDs? 

 Great!  That is exactly what I needed. 
 
 I forgot about the INTERSECTION option.
 
 Noah 
 
 -Original Message-
 (If BLORP is your savedlist from File1) GET.LIST BLORP TO 1 SELECT
 FILE2 SAVING FILE1_ID TO 2 MERGE.LIST 1 INTERSECTION 2 TO 3 
 SAVE.LIST BLAH FROM 3
 
 BLAH will contain the IDs you want, if I understand your question
 correctly.)
 
 
 --- Noah Hart [EMAIL PROTECTED] wrote:
 
  Select question:
  
  Assume that I have 2 files, such as customer and invoice
  
  File1: has 1 attribute, ID
  File2: has 2 attributes, ID and FILE1_ID
  
  I have a savedlist with ID numbers from file1.
  
  I want to select all records in file2 which have FILE1_ID 
 matching the
 
  savedlist I already have.

 ...a livable wage is a moral value. Affordable health care 
 is a moral value. A decent education is a moral value. A 
 common sense foreign policy is a moral value. A healthy 
 environment is a moral value. The feeling of community that 
 comes from full participation in our democracy is a moral 
 value. It is a moral value to make sure that we do not saddle 
 our children and grandchildren with our debt.
 
 -Howard Dean

(Hmm. I'd swear I've heard either him or his buddies say you can't
legislate morality.)
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] [UD] Select on an attribute

2005-07-25 Thread Noah Hart
Thanks Shawn,

You have pin pointed the problem.  I replied earlier to Jim that it
would work, but of course you are right, I need the FILE2 IDs, not the
FILE1 IDs

Noah 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Shawn Waldie
Sent: Monday, July 25, 2005 9:07 AM
To: u2-users@listserver.u2ug.org
Subject: RE: [U2] [UD] Select on an attribute

I could write a subr to fetch these, but I don't know how to do it with
uniquery only. I think Noah is saying that he wants to...
SELECT all File2 items if FILE1_ID can be found in the savedlist
containing the IDs from File1.

In this case, won't BLAH still contain IDs from File1?

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of Jim Bullock
 Sent: Monday, July 25, 2005 10:18 AM
 To: u2-users@listserver.u2ug.org
 Subject: Re: [U2] [UD] Select on an attribute
 
 
 (If BLORP is your savedlist from File1) GET.LIST BLORP TO 1 SELECT 
 FILE2 SAVING FILE1_ID TO 2 MERGE.LIST 1 INTERSECTION 2 TO 3 SAVE.LIST 
 BLAH FROM 3
 
 BLAH will contain the IDs you want, if I understand your question 
 correctly.)
 
 
 --- Noah Hart [EMAIL PROTECTED] wrote:
 
  Select question:
  
  Assume that I have 2 files, such as customer and invoice
  
  File1: has 1 attribute, ID
  File2: has 2 attributes, ID and FILE1_ID
  
  I have a savedlist with ID numbers from file1.
  
  I want to select all records in file2 which have FILE1_ID
 matching the
  savedlist I already have.
  
  Is this possible?
  
  Thank you,
  
  Noah
  ---
  u2-users mailing list
  u2-users@listserver.u2ug.org
  To unsubscribe please visit http://listserver.u2ug.org/
  
 
 
 ...a livable wage is a moral value. Affordable health care is a moral

 value. A decent education is a moral value. A common sense foreign 
 policy is a moral value. A healthy environment is a moral value. The 
 feeling of community that comes from full participation in our 
 democracy is a moral value. It is a moral value to make sure that we 
 do not saddle our children and grandchildren with our debt.
 
 -Howard Dean
 
 __
 Do You Yahoo!?
 Tired of spam?  Yahoo! Mail has the best spam protection around 
 http://mail.yahoo.com
 ---
 u2-users mailing list
 u2-users@listserver.u2ug.org
 To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] [UD] Select on an attribute

2005-07-25 Thread Noah Hart
Yes, see followup message 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Stevenson,
Charles
Sent: Monday, July 25, 2005 9:41 AM
To: u2-users@listserver.u2ug.org
Subject: RE: [U2] [UD] Select on an attribute

I thought you wanted a list of File2 IDs.
Won't the MERGE.LIST INTERSECTION give you a list of File1 IDs? 

 Great!  That is exactly what I needed. 
 
 I forgot about the INTERSECTION option.
 
 Noah
 
 -Original Message-
 (If BLORP is your savedlist from File1) GET.LIST BLORP TO 1 SELECT
 FILE2 SAVING FILE1_ID TO 2 MERGE.LIST 1 INTERSECTION 2 TO 3 SAVE.LIST 
 BLAH FROM 3
 
 BLAH will contain the IDs you want, if I understand your question
 correctly.)
 
 
 --- Noah Hart [EMAIL PROTECTED] wrote:
 
  Select question:
  
  Assume that I have 2 files, such as customer and invoice
  
  File1: has 1 attribute, ID
  File2: has 2 attributes, ID and FILE1_ID
  
  I have a savedlist with ID numbers from file1.
  
  I want to select all records in file2 which have FILE1_ID
 matching the
 
  savedlist I already have.

 ...a livable wage is a moral value. Affordable health care is a moral

 value. A decent education is a moral value. A common sense foreign 
 policy is a moral value. A healthy environment is a moral value. The 
 feeling of community that comes from full participation in our 
 democracy is a moral value. It is a moral value to make sure that we 
 do not saddle our children and grandchildren with our debt.
 
 -Howard Dean

(Hmm. I'd swear I've heard either him or his buddies say you can't
legislate morality.)
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/