Discussion:
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?
(too old to reply)
sueglo
2016-06-01 18:59:24 UTC
Permalink
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
k***@gmail.com
2016-06-01 20:54:53 UTC
Permalink
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.
b***@gmail.com
2016-06-02 15:54:07 UTC
Permalink
Post by sueglo
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.
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.
Ross Ferris
2016-06-05 23:47:24 UTC
Permalink
+1 for the CALL approach
sueglo
2016-06-06 16:31:23 UTC
Permalink
Post by Ross Ferris
+1 for the CALL approach
ok, thank you!
sueglo
2016-06-06 16:31:39 UTC
Permalink
Post by b***@gmail.com
Post by sueglo
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.
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!
wjhonson
2016-06-07 17:03:35 UTC
Permalink
Post by sueglo
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.
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.
Loading...