On Mar 25, 12:47=A0pm, sh <sham...@[EMAIL PROTECTED]
> wrote:
> 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
followi=
ng:
>
> >> 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 =3D "10001" "10015" "10018" ... "10526".
>
> >> So my sequence of commands would be
>
> >> SELECT file1
> >> SELECT file2 WITH field =3D
any-single-value-within-previous-select-lis=
t
>
> >> 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. =A0But 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:
> > =A0 =A0 LIST SECONDFILE WITH A4 =3D PHRASENAME
>
> > and presto-chango!!! majic happens
>
> > So create a program that will accept the list.
>
> > Something like:
>
> > open 'md' else stop 201,'md'
> > frase =3D 'h'
> > eol =3D 0
> > loop
> > =A0 =A0readnext stuff else eol =3D 1
> > until eol do
> > =A0 =A0frase<2> =3D '"':stuff:'"'
> > repeat
>
> > write frase on @[EMAIL PROTECTED]
'.frase'
>
> > Then your access statement would be
>
> > =A0 =A0 select filename with attr =3D me.frase
>
> > where 'me' is your logon id
>
> > Regards,
>
> > Dale
>
> Interesting idea.
>
> I think the line should be
>
> frase<2> =3D frase<2> : '"':stuff:'"'- Hide quoted text -
>
> - Show quoted text -
Yep.... I missed the : on the :=3D shorter version of the code.


|