I wrote REXX functions B2C, B2D, B2X, C2B, D2B, and X2B years ago. For example:

/*
C2B
 
+--------------------------------------------------------------------+
|                                                                    |
| C2B(string)                                                        |
|                                                                    |
+--------------------------------------------------------------------+
 
Character to Binary.  Converts a character string to its binary
representation.  The data may be of any length.
 
Here are some examples:
 
  C2B('72s')     +    '111101111111001010100010'
  C2B('0123'x)   +    '0000000100100011'
 
*/
 
if arg() ^= 1 then          /* Only one argument is valid              */
   return /* Incorrect call to routine */
 
arg chars
 
return x2b(c2x(chars))


If I had it to do over again, I'd probably imbed a PIPE command per Bruce's 
example:

/* C2B EXEC */

arg chars

'PIPE VAR CHARS | SPECS 1-* C2B 1 | VAR BINARY'

return binary

 

Mark Wheeler 
 
> Date: Thu, 25 Mar 2010 09:48:58 -0400
> From: [email protected]
> Subject: Re: Capping info
> To: [email protected]
> 
> Ahh... Forgot that "c2b" was only in the internal Rexx functions
> package. So, use Pipes instead:
> 'PIPE var result | specs 36.1 c2b 1 | var lparchar'
> 
> On Thu, Mar 25, 2010 at 9:38 AM, Frank M. Ramaekers
> <[email protected]> wrote:
> > C2B?
> >
> >    20 +++ lparchar=c2b(substr(result,36,1))
> > DMSREX478E Error 43 running STSIX EXEC, line 20: Routine not found
> >
> >
> > Frank M. Ramaekers Jr.
> >
> >
> >
> > -----Original Message-----
> > From: The IBM z/VM Operating System [mailto:[email protected]] On 
> > Behalf Of Bruce Hayden
> > Sent: Thursday, March 25, 2010 7:33 AM
> > To: [email protected]
> > Subject: Re: Capping info
> >
> > STSI can tell you if you are capped, but it can't tell you the weight.
> >  Borrowing from the STSIUSE SAMPEXEC on MAINT 193:
> >
> > /*************************************************************
> >  * Logical-partition CPUs                                    *
> >  *************************************************************/
> > say 'STSI(2,2,2)........................................2.2.2.'
> > result = stsi(2,2,2)
> > address command 'PIPE',
> >   '|  var result',
> >   '|  specs',
> >       '/LPAR Number:                / 1  33.2  c2x nw write',
> >       '/LCPUC:                      / 1  36.1  c2x nw write',
> >       '/Total LCPU Count:           / 1  37.2  c2d nw left write',
> >       '/Conf. LCPU Count:           / 1  39.2  c2d nw left write',
> >       '/SB LCPU Count:              / 1  41.2  c2d nw left write',
> >       '/Resv. LCPU Count:           / 1  43.2  c2d nw left write',
> >       '/Logical-Partition Name:     / 1  45.8      nw write',
> >       '/Logical-Partition CAF:      / 1  53.4  c2d nw left write',
> >       '/Ded. LCPU Count:            / 1  73.2  c2d nw left write',
> >       '/Shr. LCPU Count:            / 1  75.2  c2d nw left write',
> >   '|  cons'
> > lparchar=c2b(substr(result,36,1))
> > say 'LPAR characteristics:' lparchar
> > If substr(lparchar,1,1)=1 then say 'CPUs are dedicated'
> > If substr(lparchar,2,1)=1 then say 'CPUs are shared'
> > If substr(lparchar,3,1)=1 then say 'CPUs are limited'
> >
> >
> >
> > --
> > Bruce Hayden
> > z/VM and Linux on System z ATS
> > IBM, Endicott, NY
> >
> > _____________________________________________________
> 
> -- 
> Bruce Hayden
> z/VM and Linux on System z ATS
> IBM, Endicott, NY
                                          
_________________________________________________________________
Hotmail: Trusted email with Microsoft’s powerful SPAM protection.
http://clk.atdmt.com/GBL/go/210850552/direct/01/

Reply via email to