f



Can a dictionary do a TRANS to another file, and then a DCount on the same dictionary to count the number of Multi Valued items?

Hello Group, 

I have an I-Descriptor Dictionary that works going from one file to another and picks up attribute 1 in the other file, works great.  It is a Multivalued Field.
 
I don't know if this is possible or not, and am hoping that one of you might have an idea for me.
 
Here is the Dictionary - 
 
Pa.Cov is the file name, POLKEY IS <4> In PA.COV, 
Polkey is the Recid for the Policies.Vehicles file, Multivalued, which I need to get a count of how many there are.
 
Veh.Ct

1 I
 
2 TRANS('POLICIES.VEHICLES',POLKEY,1,'C')

 
3  

4  VEHCT

5  50L

6  SM

I get the results I want for this - takes me to the right place -

LIST PA.COV VEH.CT 02:53:36
PA.COVERAGES VehCt.........

179356       623713
             623714

182840       637952
             637951

179360       623719

175644       610255
             610256

186264       650926

177237       615841
             615842

186919       653303
             653304

172588       597821
             629263
             597822

175324       609181

179735       625290
             628839

182954       638157
183896       642215


What I would like to get for this info, take the first item for example - 
179356 should show me the number 2 because there are 2 items in the attribute <1>

I tried to add this DCOUNT on to line 2 of the dictionary above, it only gave me the number 1 - even if there were 7 items on line 1.
 
TRANS('POLICIES.VEHICLES',POLKEY,1,'C');DCOUNT(@RECORD<1>,@VM)

Is there any way any of you can think of that I can get the result I would like?  I am all ears!

Thanks, 
Susan


0
sueglo
6/1/2016 6:59:24 PM
comp.databases.pick 5449 articles. 2 followers. ttrroonniicc (5) is leader. Post Follow

6 Replies
131 Views

Similar Articles

[PageSpeed] 21

This group has essentially been replaced by the following Google group

https://groups.google.com/forum/#!forum/mvdbms

Post your question there for a better chance of getting help.
0
kpowick
6/1/2016 8:54:53 PM
On Wednesday, June 1, 2016 at 2:59:25 PM UTC-4, sueglo wrote:
> Hello Group, 
> 
> I have an I-Descriptor Dictionary that works going from one file to another and picks up attribute 1 in the other file, works great.  It is a Multivalued Field.
>  
> I don't know if this is possible or not, and am hoping that one of you might have an idea for me.
>  
> Here is the Dictionary - 
>  
> Pa.Cov is the file name, POLKEY IS <4> In PA.COV, 
> Polkey is the Recid for the Policies.Vehicles file, Multivalued, which I need to get a count of how many there are.
>  
> Veh.Ct
> 
> 1 I
>  
> 2 TRANS('POLICIES.VEHICLES',POLKEY,1,'C')
> 
>  
> 3  
> 
> 4  VEHCT
> 
> 5  50L
> 
> 6  SM
> 
> I get the results I want for this - takes me to the right place -
> 
> LIST PA.COV VEH.CT 02:53:36
> PA.COVERAGES VehCt.........
> 
> 179356       623713
>              623714
> 
> 182840       637952
>              637951
> 
> 179360       623719
> 
> 175644       610255
>              610256
> 
> 186264       650926
> 
> 177237       615841
>              615842
> 
> 186919       653303
>              653304
> 
> 172588       597821
>              629263
>              597822
> 
> 175324       609181
> 
> 179735       625290
>              628839
> 
> 182954       638157
> 183896       642215
> 
> 
> What I would like to get for this info, take the first item for example - 
> 179356 should show me the number 2 because there are 2 items in the attribute <1>
> 
> I tried to add this DCOUNT on to line 2 of the dictionary above, it only gave me the number 1 - even if there were 7 items on line 1.
>  
> TRANS('POLICIES.VEHICLES',POLKEY,1,'C');DCOUNT(@RECORD<1>,@VM)
> 
> Is there any way any of you can think of that I can get the result I would like?  I am all ears!
> 
> Thanks, 
> Susan

I find that sometimes is easier to CALL a subroutine than to figure out a way to make it work using F's, I's, T's etc.
0
brac5301
6/2/2016 3:54:07 PM

+1 for the CALL approach
0
Ross
6/5/2016 11:47:24 PM
On Sunday, June 5, 2016 at 7:47:25 PM UTC-4, Ross Ferris wrote:
> +1 for the CALL approach

ok, thank you!
0
sueglo
6/6/2016 4:31:23 PM
On Thursday, June 2, 2016 at 11:54:08 AM UTC-4, brac...@gmail.com wrote:
> On Wednesday, June 1, 2016 at 2:59:25 PM UTC-4, sueglo wrote:
> > Hello Group, 
> > 
> > I have an I-Descriptor Dictionary that works going from one file to another and picks up attribute 1 in the other file, works great.  It is a Multivalued Field.
> >  
> > I don't know if this is possible or not, and am hoping that one of you might have an idea for me.
> >  
> > Here is the Dictionary - 
> >  
> > Pa.Cov is the file name, POLKEY IS <4> In PA.COV, 
> > Polkey is the Recid for the Policies.Vehicles file, Multivalued, which I need to get a count of how many there are.
> >  
> > Veh.Ct
> > 
> > 1 I
> >  
> > 2 TRANS('POLICIES.VEHICLES',POLKEY,1,'C')
> > 
> >  
> > 3  
> > 
> > 4  VEHCT
> > 
> > 5  50L
> > 
> > 6  SM
> > 
> > I get the results I want for this - takes me to the right place -
> > 
> > LIST PA.COV VEH.CT 02:53:36
> > PA.COVERAGES VehCt.........
> > 
> > 179356       623713
> >              623714
> > 
> > 182840       637952
> >              637951
> > 
> > 179360       623719
> > 
> > 175644       610255
> >              610256
> > 
> > 186264       650926
> > 
> > 177237       615841
> >              615842
> > 
> > 186919       653303
> >              653304
> > 
> > 172588       597821
> >              629263
> >              597822
> > 
> > 175324       609181
> > 
> > 179735       625290
> >              628839
> > 
> > 182954       638157
> > 183896       642215
> > 
> > 
> > What I would like to get for this info, take the first item for example - 
> > 179356 should show me the number 2 because there are 2 items in the attribute <1>
> > 
> > I tried to add this DCOUNT on to line 2 of the dictionary above, it only gave me the number 1 - even if there were 7 items on line 1.
> >  
> > TRANS('POLICIES.VEHICLES',POLKEY,1,'C');DCOUNT(@RECORD<1>,@VM)
> > 
> > Is there any way any of you can think of that I can get the result I would like?  I am all ears!
> > 
> > Thanks, 
> > Susan
> 
> I find that sometimes is easier to CALL a subroutine than to figure out a way to make it work using F's, I's, T's etc.

ok, thank you!
0
sueglo
6/6/2016 4:31:39 PM
On Wednesday, June 1, 2016 at 11:59:25 AM UTC-7, sueglo wrote:
> Hello Group, 
> 
> I have an I-Descriptor Dictionary that works going from one file to another and picks up attribute 1 in the other file, works great.  It is a Multivalued Field.
>  
> I don't know if this is possible or not, and am hoping that one of you might have an idea for me.
>  
> Here is the Dictionary - 
>  
> Pa.Cov is the file name, POLKEY IS <4> In PA.COV, 
> Polkey is the Recid for the Policies.Vehicles file, Multivalued, which I need to get a count of how many there are.
>  
> Veh.Ct
> 
> 1 I
>  
> 2 TRANS('POLICIES.VEHICLES',POLKEY,1,'C')
> 
>  
> 3  
> 
> 4  VEHCT
> 
> 5  50L
> 
> 6  SM
> 
> I get the results I want for this - takes me to the right place -
> 
> LIST PA.COV VEH.CT 02:53:36
> PA.COVERAGES VehCt.........
> 
> 179356       623713
>              623714
> 
> 182840       637952
>              637951
> 
> 179360       623719
> 
> 175644       610255
>              610256
> 
> 186264       650926
> 
> 177237       615841
>              615842
> 
> 186919       653303
>              653304
> 
> 172588       597821
>              629263
>              597822
> 
> 175324       609181
> 
> 179735       625290
>              628839
> 
> 182954       638157
> 183896       642215
> 
> 
> What I would like to get for this info, take the first item for example - 
> 179356 should show me the number 2 because there are 2 items in the attribute <1>
> 
> I tried to add this DCOUNT on to line 2 of the dictionary above, it only gave me the number 1 - even if there were 7 items on line 1.
>  
> TRANS('POLICIES.VEHICLES',POLKEY,1,'C');DCOUNT(@RECORD<1>,@VM)
> 
> Is there any way any of you can think of that I can get the result I would like?  I am all ears!
> 
> Thanks, 
> Susan

When you do a TRANS, by requirement, the result is *lowered* (see the LOWER function) otherwise it would cause system instability.

You have to RAISE the result of the TRANS in order to get it back into it's native form.

0
wjhonson
6/7/2016 5:03:35 PM
Reply: