It's been a while since I wrote this, but sometimes an example will explain
more than pages of doc. Just a snippet of an exec I use to analyze Sas
dumps:
000246 if validtok = 1 then
000247 do
000248 subtokx = 'SUBT'
000249 "nametokn "tcbptr" str(tcb) asid("casidd")",
000250 "name((SASTK THREAD)) nolist rexx(token(subtokx))"
000251 subtokc = left(c2x(subtokx),8)
000252 if subtokc <> 'E2E4C2E3' then /* if not 'SUBT' */
000253 do
000254 eyep = eval(HexAdd(subtokc,4))
000255 /* I do binary here, due to the odd decision to have eval of
000256 character uppercase the result... */
000257 eyeb = eval(eyep,32,b)
000258 /* flip it back to character */
000259 eye = x2c(eyeb)
000260 /* truncate trailing nulls */
000261 x = pos('00'x, eye)
000262 if x = 0 then
000263 x = 32
000264 else
000265 x = x - 1
000266 eye = substr(eye, 1, x)
000267 end
000268 end
000269 GEN$ = splat'TCB: 'right(tcbptr,6)' O='right(otc,6)' CMP='cmpf,
000270 'OPSW='opsw1' 'opsw2' EP='left(ep,8)' 'eye
000271 call Put
000564 /* return value at specified address */
000565 /* */
000566 /* Parms: 1 - address */
000567 /* 2 - length of value to return (4 is default) */
000568 /* 3 - type of value to return ('C' or 'X') ('X' is default) */
000569 /* */
000570 eval: procedure expose aq
000571
000572 if arg(2) = ''
000573 then len = 4
000574 else len = arg(2)
000575
000576 if arg(3) = ''
000577 then type = x
000578 else type = arg(3)
000579
000580 "evaluate "arg(1)". "aq" le("len") "type" rexx(storage(result))"
000581
000582 if rc > 0
000583 then return -1
000584 else
000585 return result
In article <[EMAIL PROTECTED]> you wrote:
> Bob, thanks, but I guess I need to dig deeper into the REXX manuals. I
> haven't done a ton of REXX work in years, except for some IPCS stuff,
> and this one has me stumped. The token contains an address and other
> data. I was expecting that REXX(TOKEN(VAR)) would behave similar to
> REXX(STORAGE(VAR)) does in the evaluate and set the variable to an
> external format, since it doesn't, I need to find the REXX function to
> get it into this format.
> Wayne Driscoll
> Product Developer
> JME Software LLC
> NOTE: All opinions are strictly my own.
> -----Original Message-----
> From: IBM Mainframe Discussion List [mailto:[EMAIL PROTECTED] On
> Behalf Of Robert Wright
> Sent: Friday, February 01, 2008 8:26 PM
> To: [email protected]
> Subject: Re: IPCS NAMETOKN Command
> Wayne Driscoll wrote:
> > Once again I find myself writing IPCS formatting execs. My
> application
> > makes use of name/token pairs, and I am attempting to track down the
> > contents. I know how to dig the contents out myself, but I would
> prefer
> > to use the supported method, but I am having a problem. I issue the
> > command
> > Nametokn ASCBnnn nolist rexx(token(tokeval))
> > And if tokeval changes from the pre-seed that I use, I know I have
> token
> > I am looking for. All good. However, the contents of the rexx
> variable
> > is unformatted data, so how do I utilize the data? If I specify LIST
> it
> > is able to format the data, but I want to use the data for later
> > processing (basically I would like to perform in a program actions
> > similar to the actions done manually in the second example of the
> > NAMETOKN command in the IPCS Commands manual.
> REXX provides you the means to break TOKEVAL apart into the bytes that
> have independent meaning to your application. If some of that data
> yields a storage address or length, REXX can convert the binary value to
> an EBCDIC one that can be substituted into an appropriate IPCS
> subcommand to access the addressed data and the length of the instance
> referenced. If the piece is truly EBCDIC and printable in the 1st
> place, no conversion is needed.
> Bob Wright - MVS Service Aids
--
Don Poitras - SAS Development - SAS Institute Inc. - SAS Campus Drive
[EMAIL PROTECTED] (919) 531-5637 Cary, NC 27513
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html