Hi Rob,

Thank you. Looking at the specs reference, I do see PRINT <expression> where 
expression must be a numeric when PICTURE is used, otherwise a string is also 
acceptable. But so far I only have seen examples that showed something like 
PRINT #0 or PRINT a, either with or without a picture. So I wasn't aware we 
could also use a conversion in the PRINT statement.

Indeed "SET #13:=substr(#10,5,1)" and "PRINT #13 C2B nw" did the trick.

I this case I am processing the Domain 0 Record 16 monitor records. For each 
LPAR, when activated, it contains an array for the configured processors of the 
LPAR. So when there are CPU records in the array I use a while loop to parse 
out the various fields for each CPU. I also have similar ones for the Physical 
CPU records (00 17) and the CPU-MF arrays (05 13 and 05 20).

Met vriendelijke groet/With kind regards/Mit freundlichen Grüßen,
Berry van Sleeuwen
Flight Forum 3000 5657 EW Eindhoven

-----Original Message-----
From: CMSTSO Pipelines Discussion List <CMS-PIPELINES@VM.MARIST.EDU> On Behalf 
Of Rob van der Heij
Sent: Wednesday, 4 January 2023 21:35
To: CMS-PIPELINES@VM.MARIST.EDU
Subject: Re: [CMS-PIPELINES] Convert to bit value in Specs

Caution: External email. Do not open attachments or click links, unless this 
email comes from a known sender and you know the content is safe.


On Wed, 4 Jan 2023 at 18:44, Berry van Sleeuwen <berry.vansleeu...@atos.net>
wrote:

So to obtain the value I have:
> set #10:=substr(z,#2+(#0*#3)+1,#3)
> set #13:=c2x(substr(#10,5,1))
> set #14:=c2x(substr(#10,6,1))
> where #10 is the record in the array and #13 and #14 are the bit
> values. I can convert the value into a hex value with C2X but I can't
> use C2B to convert it directly into a bit value.
>
> I now have a second specs stage to print the word with a X2B
> conversion, but is there a way to print the bit value directly within
> the first specs stage?
>

I am wondering whether there aren't more attractive ways to unravel your 
records. You need to have the tool do the work...
When I care about some of the bits in a byte, I typically div and mod to get an 
integer, and use that to index in an array of values (with the
word() function).  I guess the c2b() isn't there because we didn't expect that 
would be useful in an expression. If you're just going to output it,
you could   "spec print #13 c2b " couldn't you?

Rob
This e-mail and the documents attached are confidential and intended solely for 
the addressee; it may also be privileged. If you receive this e-mail in error, 
please notify the sender immediately and destroy it. As its integrity cannot be 
secured on the Internet, Atos’ liability cannot be triggered for the message 
content. Although the sender endeavours to maintain a computer virus-free 
network, the sender does not warrant that this transmission is virus-free and 
will not be liable for any damages resulting from any virus transmitted. On all 
offers and agreements under which Atos Nederland B.V. supplies goods and/or 
services of whatever nature, the Terms of Delivery from Atos Nederland B.V. 
exclusively apply. The Terms of Delivery shall be promptly submitted to you on 
your request.

Reply via email to