Re: REXX Testing a bit?

2022-08-02 Thread Lionel B. Dyck
Of Billy Ashton Sent: Tuesday, August 2, 2022 8:29 AM To: IBM-MAIN@LISTSERV.UA.EDU Subject: Re: REXX Testing a bit? If you will be doing many of these kinds of tests, you can create a simple proc to tell you if the bit is on: BitOn: If Arg(2) > Length(Arg(1)) * 8 Then Return 9; tval

Re: REXX Testing a bit?

2022-08-02 Thread Billy Ashton
uot;Billy Ashton" To "IBM Mainframe Discussion List" Date 8/2/2022 8:40:49 AM Subject Re: REXX Testing a bit? I usually am displaying something depending on the bit setting, so I wrote a small proc: /*--

Re: REXX Testing a bit?

2022-08-02 Thread Paul Gilmartin
On Tue, 2 Aug 2022 07:43:17 -0500, Dale R. Smith wrote: >On Tue, 2 Aug 2022 06:50:10 -0500, Lionel B. Dyck wrote: >> >>If substr(x2b(c2x(flag1)),6,1) = 1 then say 'got it' >> Some say "= 1" is superfluous, pleonasm. However: o Others say it adds clarity. o Others insist on maintaining the

Re: REXX Testing a bit?

2022-08-02 Thread Colin Paice
if BITAND(invalue, '01'x) = '01'x On Tue, 2 Aug 2022 at 12:50, Lionel B. Dyck wrote: > What is the best way to test if a bit is 1 or 0? > > > > I'm doing this but was thinking there may/probably is a better way: > > > > If substr(x2b(c2x(flag1)),6,1) = 1 then say 'got it' > > > > > >

Re: REXX Testing a bit?

2022-08-02 Thread Dale R. Smith
On Tue, 2 Aug 2022 06:50:10 -0500, Lionel B. Dyck wrote: >What is the best way to test if a bit is 1 or 0? > > > >I'm doing this but was thinking there may/probably is a better way: > > > >If substr(x2b(c2x(flag1)),6,1) = 1 then say 'got it' > > > > > >Lionel B. Dyck <>< Assuming flag1 is a

Re: REXX Testing a bit?

2022-08-02 Thread Itschak Mugzach
i use if (bitand(xxx) = x'80') (or any other hex value that match your bit position ITschak *| **Itschak Mugzach | Director | SecuriTeam Software **|** IronSphere Platform* *|* *Information Security Continuous Monitoring for Z/OS, zLinux and IBM I **| * *|* *Email**: i_mugz...@securiteam.co.il

Re: REXX Testing a bit?

2022-08-02 Thread Billy Ashton
y Ashton -- Original Message -- From "Lionel B. Dyck" To IBM-MAIN@listserv.ua.edu Date 8/2/2022 7:50:10 AM Subject REXX Testing a bit? What is the best way to test if a bit is 1 or 0? I'm doing this but was thinking there may/probably is a better way: If sub

Re: REXX Testing a bit?

2022-08-02 Thread David Spiegel
Hi Lionel, (assuming Rexx) you can omit "=1" Regards, David On 2022-08-02 07:50, Lionel B. Dyck wrote: What is the best way to test if a bit is 1 or 0? I'm doing this but was thinking there may/probably is a better way: If substr(x2b(c2x(flag1)),6,1) = 1 then say 'got it'

REXX Testing a bit?

2022-08-02 Thread Lionel B. Dyck
What is the best way to test if a bit is 1 or 0? I'm doing this but was thinking there may/probably is a better way: If substr(x2b(c2x(flag1)),6,1) = 1 then say 'got it' Lionel B. Dyck <>< Website: https://www.lbdsoftware.com Github: