It's very simple - but you must set the value to the compound variable 
"stem.0a" directly: stem.0a = 'XXX', you can't use 0a = 'XXX'! 

Example:  

stem. = ''
stem.0 = imax

Do  i = 1 To stem.0
    ...
    stem.i.0 = jmax
    ...
    Do  j = 1 To stem.i.0
        ...
        stem.i.j.0name = 'THOMAS' 
    End
End

...
Say stem.i.j.0name   /* maybe prints "THOMAS" */  

- If you want to use a variable/free format of the compound tail you could:

tail = 'name'
x = Value("stem."i"."j".0"tail,"THOMAS") 


(I hope you're not suing me!  :) )



Regards
Thomas Berg
____________________________________________________________________
Thomas Berg   Specialist   z/OS\RQM\IT Delivery   SWEDBANK AB (Publ)


> -----Original Message-----
> From: IBM Mainframe Discussion List [mailto:[email protected]]
> On Behalf Of Bill Ashton
> Sent: Thursday, June 13, 2013 4:54 PM
> To: [email protected]
> Subject: Re: Thinking about utility for REXX: stem variable to JSON
> encoding.
> 
> Thomas, I tried a few things suing a stemname like 0a, and I could not
> get that to work...Can you give me an example of how you use this, and
> how you increment stem variables, so I can see this in action?
> 
> Thanks!
> Billy
> 
> 
> On Thu, Jun 13, 2013 at 10:20 AM, Thomas Berg
> <[email protected]>wrote:
> 
> > > -----Original Message-----
> > > From: IBM Mainframe Discussion List
> > > [mailto:[email protected]] On Behalf Of John McKown
> > > Sent: Thursday, June 13, 2013 3:36 PM
> > > To: [email protected]
> > > Subject: Thinking about utility for REXX: stem variable to JSON
> > > encoding.
> >
> > <snip>
> >
> > > STEM.0=3
> > > STEM.1=A
> > > STEM.2=B
> > > STEM.3=C
> > > A="A" /* JUST TO BE SURE */
> > > STEM.A='BUBBA'
> > >
> > > Even worse, as above, but also
> > >
> > > STEM.A.0=1
> > > STEM.A.1="FETT"
> >
> > Be aware that using the name stem.a is vulnerable to eventual usage
> of
> > the variable "a".
> >
> > I always use the format "stem.0a" as "0a" is not a valid variable
> name.
> >  Which protects "stem.0a".
> >
> >
> >
> > Regards
> > Thomas Berg
> > ____________________________________________________________________
> > Thomas Berg   Specialist   z/OS\RQM\IT Delivery   SWEDBANK AB (Publ)
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> -
> > For IBM-MAIN subscribe / signoff / archive access instructions, send
> > email to [email protected] with the message: INFO IBM-MAIN
> >
> 
> 
> 
> --
> Thank you and best regards,
> *Billy Ashton*
> 
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions, send
> email to [email protected] with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to