T.L. Ashford has over 28 years of experience in software development and backs that commitment with a highly qualified technical support team.
You can count on T.L. Ashford for your bar code, compliance and RFID labeling needs. Call 800-541-4893 to see what Barcode400 Software can do for you or use the Live Chat feature at www.tlashford.com
Extracting a bit can be done a number of ways, but the code in this article uses only the basic arithmetic capabilities of CL.
Written by Joe Pluta
This article is sort of the antithesis of what we normally do in RPG Developer. Sometimes, you need to do things in CL without calling an RPG program. The situation is rare, but it happens. One case may be where you have to provide the source to the program in question but you can't count on the RPG compiler being there. And no matter how much IBM has improved the language (and it's been quite a bit), some things really can't be done in CL. But in this article, I want to show you how to do something in CL you may have thought was not possible: extract the value of a single bit.
The Local Data Area (LDA) is a user-domain, permanent space object (with MI object type code/subtype code hex 19CE) that is allocated to each IBM i job by the system when the job becomes active. The 1024-byte storage of an LDA can be accessed through CL commands (DSPDTAARA, RTVDTAARA, CHGDTAARA, and CHGVAR), APIs (QXXRTVDA and QXXCHGDA), or built-in support of high-level languages (the IN and OUT opcodes of RPG, and the ACCEPT and DISPLAY statements of COBOL).
Control Language (CL) is a critical skill for anyone working with IBM i, but why settle for just enough CL knowledge to get by? From the simplest task to the most complex process, CL is at the heart of your server. Become a CL guru and fully leverage the abilities of your system. All it takes is a little time, effort, and Complete CL, 5th Edition. Now available in eBook format. >> Read More >>