Could you explain this new command a bit more? I want to make sure
that if I were to put that in that it would not cause the dictionary
items that I have now to stop working properly.
The CORRELATIVE.REUSE setting of the OPTION command was added at release 2.9-7 but not documented until 2.9-8 because we wanted to confirm with the user that requested it that we had it correct (which we did).
As we will see below, part of the original problem may turn out to be that QM executes correlatives in a different way from Pick systems.
The precise behaviour of correlatives is not very well documented in any of the mv systems. We based our implementation on information extracted from documentation for PI/open, UniVerse, D3, mvBase and several training packages from Malcolm Bull.
There is frequent reference in these documents to the use of the R qualifier after a data item to imply an operation equivalent to use of the REUSE() function in QMBasic. Using the horrors of an F-correlative as my example, I might have something like F;'~';1;: to prefix the content of field 1 with a tilde. This is equivalent to use of a QMBasic expression CATS('~', @RECORD<1>)
But, what if field 1 is multivalued? According to many of the mv correlative documents, I must amend my correlative to be F;'~'R;1;: which is equivalent to CATS(REUSE('~'), @RECORD<1>)
So far, all is ok. Now let's say that I want my correlative to return the record id (which is always single valued) followed by a tilde and then the content of multivalued field 1. It looks as though I need to write F;0;'~';1 but I somehow need to insert an R option that will be applied to the result of the first concatenation. The language doesn't have a way to do this.
I suspect that the underlying problem is that QM converts correlatives to the equivalent multivalued functions of QMBasic. From talking with the user who raised this issue, it seems that Pick systems execute the correlative multiple times, once for each value in the multivalued data whereas QM executes the composite expression just once, handling the multivalues internally. In most cases, there is no difference between these two approaches.
Pondering on this leads to a question... What does the R option actually do in Pick? If the expression is evaluated many times, it doesn't appear to be needed. Nothing in any of the documentation we have here explains what actually happens.
The solution that we came up with that appears to work in all cases is to add the CORRELATIVE.REUSE option which causes all correlative operators to behave as though the R option was present, even those like my double concatenation where there is nowhere in the expression syntax to insert the R. It was suggested that we should make this behaviour standard but, just in case there is some case where it would have undesireable effects, we made it an option.
QM has never guaranteed 100% compatibility with Pick or any other system but we aim to make migration easy. We have many users who have migrated from Pick style systems over the last few years and this is the first time this incompatibility has come up. We discussed various solutions with the user and decided that the new OPTION setting was the best. Only time will tell. I suggest that you only enable this setting if you have correlatives that are not working because of the problem described above. Then there is no risk of anything else going wrong.
Martin Phillips Ladybridge Systems Ltd 17b Coldstream Lane, Hardingstone, Northampton, NN4 6DB +44-(0)1604-709200
> The CORRELATIVE.REUSE setting of the OPTION command was added at release 2.9-7 but not documented until 2.9-8 because we wanted to confirm with the user that requested it that we had it correct (which we did).
> As we will see below, part of the original problem may turn out to be that QM executes correlatives in a different way from Pick systems.
> The precise behaviour of correlatives is not very well documented in any of the mv systems. We based our implementation on information extracted from documentation for PI/open, UniVerse, D3, mvBase and several training packages from Malcolm Bull.
> There is frequent reference in these documents to the use of the R qualifier after a data item to imply an operation equivalent to use of the REUSE() function in QMBasic. Using the horrors of an F-correlative as my example, I might have something like
> F;'~';1;:
> to prefix the content of field 1 with a tilde. This is equivalent to use of a QMBasic expression
> CATS('~', @RECORD<1>)
> But, what if field 1 is multivalued? According to many of the mv correlative documents, I must amend my correlative to be
> F;'~'R;1;:
> which is equivalent to
> CATS(REUSE('~'), @RECORD<1>)
> So far, all is ok. Now let's say that I want my correlative to return the record id (which is always single valued) followed by a tilde and then the content of multivalued field 1. It looks as though I need to write
> F;0;'~';1
> but I somehow need to insert an R option that will be applied to the result of the first concatenation. The language doesn't have a way to do this.
> I suspect that the underlying problem is that QM converts correlatives to the equivalent multivalued functions of QMBasic. From talking with the user who raised this issue, it seems that Pick systems execute the correlative multiple times, once for each value in the multivalued data whereas QM executes the composite expression just once, handling the multivalues internally. In most cases, there is no difference between these two approaches.
> Pondering on this leads to a question... What does the R option actually do in Pick? If the expression is evaluated many times, it doesn't appear to be needed. Nothing in any of the documentation we have here explains what actually happens.
> The solution that we came up with that appears to work in all cases is to add the CORRELATIVE.REUSE option which causes all correlative operators to behave as though the R option was present, even those like my double concatenation where there is nowhere in the expression syntax to insert the R. It was suggested that we should make this behaviour standard but, just in case there is some case where it would have undesireable effects, we made it an option.
> QM has never guaranteed 100% compatibility with Pick or any other system but we aim to make migration easy. We have many users who have migrated from Pick style systems over the last few years and this is the first time this incompatibility has come up. We discussed various solutions with the user and decided that the new OPTION setting was the best. Only time will tell. I suggest that you only enable this setting if you have correlatives that are not working because of the problem described above. Then there is no risk of anything else going wrong.
> Martin Phillips
> Ladybridge Systems Ltd
> 17b Coldstream Lane, Hardingstone, Northampton, NN4 6DB
> +44-(0)1604-709200
> The CORRELATIVE.REUSE setting of the OPTION command was added at release > 2.9-7 but not documented until 2.9-8 because we wanted to confirm with > the user that requested it that we had it correct (which we did).
> As we will see below, part of the original problem may turn out to be > that QM executes correlatives in a different way from Pick systems.
> The precise behaviour of correlatives is not very well documented in any > of the mv systems. We based our implementation on information extracted > from documentation for PI/open, UniVerse, D3, mvBase and several > training packages from Malcolm Bull.
> There is frequent reference in these documents to the use of the R > qualifier after a data item to imply an operation equivalent to use of > the REUSE() function in QMBasic. Using the horrors of an F-correlative > as my example, I might have something like > F;'~';1;: > to prefix the content of field 1 with a tilde. This is equivalent to use > of a QMBasic expression > CATS('~', @RECORD<1>)
> But, what if field 1 is multivalued? According to many of the mv > correlative documents, I must amend my correlative to be > F;'~'R;1;: > which is equivalent to > CATS(REUSE('~'), @RECORD<1>)
> So far, all is ok. Now let's say that I want my correlative to return > the record id (which is always single valued) followed by a tilde and > then the content of multivalued field 1. It looks as though I need to write > F;0;'~';1 > but I somehow need to insert an R option that will be applied to the > result of the first concatenation. The language doesn't have a way to do > this.
> I suspect that the underlying problem is that QM converts correlatives > to the equivalent multivalued functions of QMBasic. From talking with > the user who raised this issue, it seems that Pick systems execute the > correlative multiple times, once for each value in the multivalued data > whereas QM executes the composite expression just once, handling the > multivalues internally. In most cases, there is no difference between > these two approaches.
> Pondering on this leads to a question... What does the R option actually > do in Pick? If the expression is evaluated many times, it doesn't appear > to be needed. Nothing in any of the documentation we have here explains > what actually happens.
> The solution that we came up with that appears to work in all cases is > to add the CORRELATIVE.REUSE option which causes all correlative > operators to behave as though the R option was present, even those like > my double concatenation where there is nowhere in the expression syntax > to insert the R. It was suggested that we should make this behaviour > standard but, just in case there is some case where it would have > undesireable effects, we made it an option.
> QM has never guaranteed 100% compatibility with Pick or any other system > but we aim to make migration easy. We have many users who have migrated > from Pick style systems over the last few years and this is the first > time this incompatibility has come up. We discussed various solutions > with the user and decided that the new OPTION setting was the best. Only > time will tell. I suggest that you only enable this setting if you have > correlatives that are not working because of the problem described > above. Then there is no risk of anything else going wrong.
> Martin Phillips > Ladybridge Systems Ltd > 17b Coldstream Lane, Hardingstone, Northampton, NN4 6DB > +44-(0)1604-709200
> Did that one line of comment really require 92 lines of quotes?
> Feeling very crochety at the moment,
Please do not include the whole of a lengthy post in each reply. The whole point of a Google group is that you can look back at past contributions to the thread. Include just enough to indicate what point you are replying to.
Re the CORRELATIVE.REUSE option, we have also placed a new item in the QM KnowledgeBase that includes much of the same text as the response posted yesterday. Ideas for new topics that are perhaps inappropriate for the main manuals are always welcome.
> > Did that one line of comment really require 92 lines of quotes?
> > Feeling very crochety at the moment,
> Please do not include the whole of a lengthy post in each reply. The whole
> point of a Google group is that you can look back at past contributions to
> the thread. Include just enough to indicate what point you are replying to.
> Re the CORRELATIVE.REUSE option, we have also placed a new item in the QM
> KnowledgeBase that includes much of the same text as the response posted
> yesterday. Ideas for new topics that are perhaps inappropriate for the main
> manuals are always welcome.
Having worked with some of the original R83 A/F code when doing
consulting for some of the old Pick licensees, I can confirm that
indeed the correlative / conversion is evaluated repeatedly for multi-
values (and sub-values I think). Initially the value counter is set to
1 and the function is executed. Any attribute references are scanned
to the current value count and only that value is processed. If the
current value of the attribute reference being processed is terminated
by a value-mark character (indicating another value to come) a flag is
set and after the current iteration has completed, the value counter
is incremented and the whole thing is repeated. If an attribute
reference has a trailing "R", the scan to the current multi-value is
skipped and the attribute is treated as a repeating single-valued
operand. Constants are always repeated. The process repeats until the
execution terminates without the flag set.
Thanks for a concise description of what happens. This is not quite what we do but we are probably close enough. There may be the odd correlative that needs modification but they should be rare. It has taken several years of migrations to encounter the first one.