2 回答
Many times NV and NS only work when using BY-EXP in your LIST or SELECT statements. You need to use modifiers that specifically look at MultiValue and SubValues.
WHEN is one, and BY-EXP is another. There are other, but not sure what they are off the top of my head. I primarly use BY-EXP and BY-EXP-DSND.
LIST MyFile BY-EXP LETTER = "A" BY-EXP FRUIT ="Apple" LETTER FRUIT LETTER.COMBO
To bring back all the combinations, you use need to do the following:
LIST MyFile BY-EXP LETTER LETTER FRUIT LETTER.COMBO
Change the following virtual field from 'LETTER' to say 'LETTER.COMBO' or something along those lines:
<1> = I
<2> = EXTRACT(@RECORD,1,@NV,1);EXTRACT(FRUIT,1,@NV,1);@1:" (":@2:")" : @NS
<3> =
<3> = Letter
<4> = 6L
<5> = M
<6> = COMBO
Hope that helps.
-Nathan
To answer part of my own question:
Only 'WHEN' is affected by the association, not with. If you turn on UDT.OPTIONS 94 and do
LIST MyFile WHEN LETTER = "A" AND FRUIT="Apple" COMBO
when using my D-Type definition of LETTER, I get
LIST MyFile WHEN LETTER = "A" AND FRUIT="Apple" LETTER FRUIT 16:06:42 26 FEB 2010 1
MyFile.... LETTER.............. FRUIT...............
RECORD A Apple
1 record listed
Which is what one would expect.
To use the WHEN clause you need to be in ECLTYPE U, not P. IT would be helpful if this was clearer, but oh well...