On Mar 25, 3:19=A0pm, Dale <dale_bened...@[EMAIL PROTECTED]
> wrote:
> On Mar 25, 11:58=A0am, 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
followin=
g:
>
> > 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-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. =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- Hide quoted text -
>
> - Show quoted text -
Dale, is there a limit to the length allowed using attribute 2 of an H
type MD?
What about speedwise, if you're dealing with a large number of items
are you better off with a tem****ary file that gets deleted or an H
record that gets deleted when the process is completed?
(Recommendation: if sh chooses to create an H MD, it should be named
H****tnumber and deleted when the process is completed, to avoid two
people using the same H item for different purposes at the same time)


|