In that case create this dictionary in FILE2:

ID: ATTR4
001 A
002 4
003
004
005
006
007
008 TFILE1;X;;0
009 L
010 10

[ or create a similar I-type using the TRANS() function ]

then

SELECT FILE2 WITH ATTR4

That should do it!

Dan

On Fri, Dec 11, 2009 at 1:26 PM, JOSE L MARTINEZ-AVIAL <[email protected]> wrote:
> I think that what Treg is asking is how to do something like the following:
>
>   SELECT FILE1
>   SAVE-LIST MYLIST
>
>   SELECT FILE2 WITH ATTR4 EQ MYLIST
>
> So, the question is how to use a selection to select records in other file
> not by id, but by another attribute. I'd like to know if it's possible to,
> it would make my life easier.
>
> Regards
>
> Jose
>
> 2009/12/11 Daniel Klein <[email protected]>
>>
>> SELECT file1 *A4 *A5
>> SAVE-LIST mylist
>> GET-LIST mylist
>> SELECT file2
>>
>> If the data is multi-valued or sub-valued then construct a dictionary
>> items like this:
>>
>> ID: A4
>> 001 I
>> 002 @RECORD<4,1,1>
>> 003
>> 004
>> 005 10L
>>
>> ID: A5
>> 001 I
>> 002 @RECORD<5,1,1>
>> 003
>> 004
>> 005 10L
>>
>> then change the first statement to:
>>
>> SELECT file1 A4 A5
>>
>> Dan
>>
>> On Thu, Dec 10, 2009 at 4:03 PM, Treg Taylor
>> <[email protected]> wrote:
>> > Jim:
>> >
>> > I know, I know, Win2K.... arrggghhhh;  thems the breaks.
>> >
>> > Well this is a mute point now, as the data extract requirements have
>> > changed.
>> >
>> > FYI:  I was looking at identifying rows in one file where attrib 4.1.1
>> > or attrib 5.1.1 was listed in a file of 61K rows.
>> >
>> > Thanks for your help
>> >
>> > Treg
>> >
>> >
>> >
>> > -----Original Message-----
>> > From: [email protected] [mailto:[email protected]] On Behalf
>> > Of Jim Idle
>> > Sent: Thursday, December 10, 2009 2:22 PM
>> > To: [email protected]
>> > Subject: RE: JBASE: HowTo Select from a Select?
>> >
>> > You need to be more specific.
>> >
>> > When you say attribute 4 or attribute 5 equals the values, do you mean
>> > that every value in attribute 4 or attribute 5 should equal each element of
>> > the stored list (in order?), or that all values of attribute 4 or attribute
>> > 5 should be found anywhere in the stored list, or that any value of
>> > attribute 4 or attribute 5 is equal to any element of the stored list, or
>> > that any value of attribute 4 or attribute 5 correlates with a value at the
>> > same position in the stored list. Are attribute 4 and 5 even multivalued
>> > (though strictly speaking, they are multivalued even if they have no
>> > elements)?
>> >
>> > Depending on what you mean (and with the CUBS software, it could be any
>> > of those ;-), you could generate a jQL statement:
>> >
>> > SELECT FILE WITH ATTR4 = "v1" "v2" "v3" ... OR WITH ATTR5 = "v1" "v2"
>> > "v3" ....
>> >
>> > Then use the resulting list to drive JCOPY. But the semantics of the
>> > select may not be what you are trying for.
>> >
>> > To be honest, it sounds like you are going about whatever it is you want
>> > to do, the wrong way. What you are trying to do will be very inefficient.
>> > Why don't you step back and say what you are trying to do, where this magic
>> > list is generated from and why it is generating a list.
>> >
>> > It would be very much more efficient to write a small program to do this
>> > and the program would take very little time to write. If this is going to 
>> > be
>> > an application task that happens a lot, then you want a program that does
>> > the whole task and not have something else produce a list, then pick it up.
>> >
>> > Jim
>> > PS: Windows 2000? ;-)
>> >
>> >> -----Original Message-----
>> >> From: [email protected] [mailto:[email protected]] On Behalf
>> >> Of Treg Taylor
>> >> Sent: Thursday, December 10, 2009 9:15 AM
>> >> To: [email protected]
>> >> Subject: JBASE: HowTo Select from a Select?
>> >>
>> >> All-
>> >>
>> >> TASK: Jcopy records from one file to another.
>> >>
>> >> ISSUE:  I have a saved select list, I would like to select against a
>> >> file where attrib 4 or 5 equals the values from the saved select list.
>> >> Then copy the records to another file.
>> >>
>> >> If I were in sql, I would use an INNER JOIN or a WHERE - IN clause.
>> >>
>> >> Thanks in advance,
>> >>
>> >> Treg
>> >> ========
>> >> System: Win2K CUBS 5.0 i386
>> >> OS Release: Win 2000  Build 2195  Service Pack 4
>> >> RELEASE Information: Major 3.4 , Minor 2 , Patch 05
>> >>
>> >>
>> >> Notice: This electronic transmission and its attachments are
>> >> confidential and protected by applicable state and/or federal law.  Any
>> >> use, reading, dissemination, distribution, copying or storage of this
>> >> information by anyone other than the intended recipient is strictly
>> >> prohibited.  If you are not the intended recipient, please immediately
>> >> notify the sender by return email or telephone and delete this message
>> >> and its attachments from your system.
>> >>
>> >> --
>> >> Please read the posting guidelines at:
>> >> http://groups.google.com/group/jBASE/web/Posting%20Guidelines
>> >>
>> >> IMPORTANT: Type T24: at the start of the subject line for questions
>> >> specific to Globus/T24
>> >>
>> >> To post, send email to [email protected]
>> >> To unsubscribe, send email to [email protected]
>> >> For more options, visit this group at
>> >> http://groups.google.com/group/jBASE?hl=en
>> >
>> >
>> >
>> > --
>> > Please read the posting guidelines at:
>> > http://groups.google.com/group/jBASE/web/Posting%20Guidelines
>> >
>> > IMPORTANT: Type T24: at the start of the subject line for questions
>> > specific to Globus/T24
>> >
>> > To post, send email to [email protected]
>> > To unsubscribe, send email to [email protected]
>> > For more options, visit this group at
>> > http://groups.google.com/group/jBASE?hl=en
>> >
>> > Notice: This electronic transmission and its attachments are
>> > confidential and protected by applicable state and/or federal law.  Any 
>> > use,
>> > reading, dissemination, distribution, copying or storage of this 
>> > information
>> > by anyone other than the intended recipient is strictly prohibited.  If you
>> > are not the intended recipient, please immediately notify the sender by
>> > return email or telephone and delete this message and its attachments from
>> > your system.
>> >
>> > --
>> > Please read the posting guidelines at:
>> > http://groups.google.com/group/jBASE/web/Posting%20Guidelines
>> >
>> > IMPORTANT: Type T24: at the start of the subject line for questions
>> > specific to Globus/T24
>> >
>> > To post, send email to [email protected]
>> > To unsubscribe, send email to [email protected]
>> > For more options, visit this group at
>> > http://groups.google.com/group/jBASE?hl=en
>> >
>>
>> --
>> Please read the posting guidelines at:
>> http://groups.google.com/group/jBASE/web/Posting%20Guidelines
>>
>> IMPORTANT: Type T24: at the start of the subject line for questions
>> specific to Globus/T24
>>
>> To post, send email to [email protected]
>> To unsubscribe, send email to [email protected]
>> For more options, visit this group at
>> http://groups.google.com/group/jBASE?hl=en
>
> --
> Please read the posting guidelines at:
> http://groups.google.com/group/jBASE/web/Posting%20Guidelines
>
> IMPORTANT: Type T24: at the start of the subject line for questions specific
> to Globus/T24
>
> To post, send email to [email protected]
> To unsubscribe, send email to [email protected]
> For more options, visit this group at
> http://groups.google.com/group/jBASE?hl=en
>

-- 
Please read the posting guidelines at: 
http://groups.google.com/group/jBASE/web/Posting%20Guidelines

IMPORTANT: Type T24: at the start of the subject line for questions specific to 
Globus/T24

To post, send email to [email protected]
To unsubscribe, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/jBASE?hl=en

Reply via email to