|
<PRE>
Hi,
I need to expand a 3 character string to 4 characters
a-la base64 encoding. C is not available right now -
but MI is. So armed with Leif's excellent book and an
MI manual I discovered the CPYBTL operation which
appears to be just the ticket. But it seems no matter
what I try I can not get the expected results.
Expected results:
24 22 9 35
Actual results (repeatedly no matter what gyrations I
try):
00 22 00 00
So what am I missing about CPYBTL?
Here's the code:
/*
12345678123456781234567812345678 */
DCL DD SOURCE CHAR(4)
INIT(X'01100001011000100110001100000000');
/* 97
98 99 0 */
DCL DD RECEIVER1 BIN(4) UNSGND;
DCL DD RECEIVER2 BIN(4) UNSGND;
DCL DD RECEIVER3 BIN(4) UNSGND;
DCL DD RECEIVER4 BIN(4) UNSGND;
DCL DD RECEIVER CHAR(1);
/* Do the deed */
CPYBTL RECEIVER1, SOURCE, 1, 6;
CPYBTL RECEIVER2, SOURCE, 7, 6;
CPYBTL RECEIVER3, SOURCE, 13, 6;
CPYBTL RECEIVER4, SOURCE, 19, 6;
/* make the results displayable */
CPYBRA RECEIVER, RECEIVER1;
CVTHC MSG-TEXT( 1:2), RECEIVER;
CPYBRA RECEIVER, RECEIVER2;
CVTHC MSG-TEXT( 4:2), RECEIVER;
CPYBRA RECEIVER, RECEIVER3;
CVTHC MSG-TEXT( 7:2), RECEIVER;
CPYBRA RECEIVER, RECEIVER4;
CVTHC MSG-TEXT(10:2), RECEIVER;
/* display the results */
CALLI SHOW-MESSAGE, *, .SHOW-MESSAGE;
RTX *;
%INCLUDE SHOWMSG
=-=-=-=-=-=-
Thanks guys!
Tom Daly
</PRE>
__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com
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.