|
Don I use this procedure code for converting bytes into bits. Wrap it up in a service program and you're golden. Typically I define a structure of indicators into which to return the data, as in the following example from the QDFRTVFD API: * * Display-File-Level Device-Dependent Section * D QDFFDPDD DS BASED(QDFFDPDD@) D 8A D WDFFFKWD 2A D 2A D WDFFSHB1 1A D 2A D WDFFSHRA 1A D WDFFCKY1 1A D WDFFCKY2 1A D WDFFCKY3 1A D WDFFMKWD 1A D WDFFMKW2 1A D 3A D WDFFXDOC 5I 0 * * Miscellaneous keywords * D WDFFFKWDDS DS D WDFFOPEN N D WDFFCLRL N D WDFFFIVC N D WDFFAGPH N D WDFFXHRD N D WDFFUDMT N D WDFFPRPG N D WDFFHSIO N D WDFFXHTL N D WDFFXUIM N D WDFFXHDC N D 1A D WDFFALTN N D WDFFHFUL N D WDFFESFL N D WDFFFWDW N C Eval WDFFFKWDDS = bitform( WDFFFKWD : 2 ) and then test each of the indicators in WDFFFKWDDS. Rory *===================================================================== * Get bit pattern (mimic format of PL/I UNSPEC operation) *===================================================================== P bitform B Export D PI 4096A D String 512A Const D StringLen 10I 0 Const *--------------------------------------------------------------------- D Pos S 10I 0 Inz(1) D Char S 1A Inz D RtnVal S 4096A Inz D SavInd S 8A Inz D WrkInd S 8A Inz *--------------------------------------------------------------------- * * Save existing indicators 50 - 57. * C Movea *IN(50) SavInd * C 1 Do StringLen Pos * C Eval Char = %subst( String : Pos : 1 ) * C Testb '0' Char 50 C Testb '1' Char 51 C Testb '2' Char 52 C Testb '3' Char 53 C Testb '4' Char 54 C Testb '5' Char 55 C Testb '6' Char 56 C Testb '7' Char 57 * * Update return value * C Movea *IN(50) WrkInd C Eval %subst( RtnVal : (Pos * 8) - 7 ) = WrkInd * C Enddo * * Set up return value, reset original indicators 50 - 57 and return. * C Movea SavInd *IN(50) C Return RtnVal * C *PSSR Begsr C Movea SavInd *IN(50) C Return *Allx'00' C Endsr * P E
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.