Dale wrote:
> On Mar 25, 11:58 am, sh <sham...@[EMAIL PROTECTED]
> wrote:
>> I've come across the following need on a number of occasions, and I'm
>> wondering if there already exists a D3 command that will do the
following:
>>
>> I get a SAVE-LIST of values from some source
>>
>> 001 10001
>> 002 10015
>> 003 10018
>> ...
>> 100 10526
>>
>> I now want to SELECT off another file, but the values in the SAVE-LIST
>> are not item-ids in the second file, but are values (or multivalues) in
>> a field within the second file.
>>
>> In other words, I want the ACCESS command to morph to
>>
>> SELECT file WITH field = "10001" "10015" "10018" ... "10526".
>>
>> So my sequence of commands would be
>>
>> SELECT file1
>> SELECT file2 WITH field = any-single-value-within-previous-select-list
>>
>> I know I can probably get around this by using some sort of REFORMAT
>> into a tem****ary file, but that's messy. I'm looking for something
>> straightforward.
>>
>> Does such a command already exist in D3, or do I have to roll my own?
>
> As far as I know you have to roll your own. But what you want to do
> doesn't take much if you look at phrases.
>
> What you need to do is create the list of things you want to search on
> in the format "a1""a2""a3""a4"... put this in attribute 2 and an 'H'
> in attribute 1 and store in the md under a unique name.
>
> Then use the access statement:
> LIST SECONDFILE WITH A4 = PHRASENAME
>
> and presto-chango!!! majic happens
>
> So create a program that will accept the list.
>
> Something like:
>
> open 'md' else stop 201,'md'
> frase = 'h'
> eol = 0
> loop
> readnext stuff else eol = 1
> until eol do
> frase<2> = '"':stuff:'"'
> repeat
>
> write frase on @[EMAIL PROTECTED]
'.frase'
>
>
> Then your access statement would be
>
> select filename with attr = me.frase
>
> where 'me' is your logon id
>
> Regards,
>
> Dale
Interesting idea.
I think the line should be
frase<2> = frase<2> : '"':stuff:'"'


|