Well, it almost worked. It looks like if you define nextcode for one
subscript, they all need nextcode code. With only L3 nextcode defined L1 and
L2 do not change. An SQL query of all the records in the table gets stuck in
a loop that returns rows for the first values of L1 and L2 over and over. So
I'm thinking that I need to add nextcode to increment L1 and L2 like below.
Although this returns rows, aggregation functions like sum() and count() do
not work because I think it still loops. I also had to reset L3 to 100 to
start on the next subscript. Please let me know if there is a trick to
getting L1 and L2 to automatically increment when there is nextcode code in
L3.



Thanks.



subscript 1

    {

     expression = {SUB1};

     nextcode =

     [

     S {L1}=$O(^glo({L1}))

     I {L1}="" Q

     ]

      }

subscript 2

    {

    expression = {SUB2};

    }

subscript 3

    {

    expression = {SUB3);

     nextcode =

     [

     S {L3}={L3}+100

     I '$D(^glo({L1},{L2},{L3}))

         {

          S {L3}=100

          S {L2}=$O(^glo({L1},{L2}))

          Q

         }

     ]

     }


"David Van De Griek" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Steve,
>
> Try using {L3} instead of {S3}.
> {L#} is the external representation of the subscript level and {S#} is
> the internal representation.
>
> Also, you'll need to tell the code when to stop.  You probably should do
> something like:
>
>        nextcode = {
>                    Set {L3}={L3}+100
>                    If '$Data(^glo({L1},{L2},{L3})) Quit
>        }
>
> -dave
>
>
> Steve wrote:
> > I'm trying to map an existing global using CacheSQLStorage and only
return
> > rows that have a number that is a multiple of 100 in subscript 3. I'm
> > guessing that I need to use nextcode in my CDL to start at 100 and
increment
> > the value of the field/subscript by 100. Like this:
> >
> >
> >
> > subscript 3 {
> >
> >            nextcode = {
> >
> >                         S {S3}={S3}+100
> >
> >            }
> >
> >             startvalue=100;
> >
> > }
> >
> > However, I get the error: #524: Invalid {Field} reference.
> >
> >
> >
> > Any suggestions? I'm using Cache' 4.1.9.
> >
> >



Reply via email to