At 23:30 -0400 on 08/07/2014, Tony Harminc wrote about Re: Convert to base64 help:

It's just the same with base64, but the algorithm is a wee bit more
complex. So the problem almost certainly lies with your input; not the
implementation. If you want interoperability with ASCII-based
conversion programs, then you must present ASCII input to your
assembler program or EBCDIC input to the ASCII-based routine.

Assuming that the input is text and you want the same Base64 as would be returned by the Internet Base64 routine, you need to make sure the input is ASCII. Since your routine is being passed EBCDIC you must change the text string to ASCII first. Also the output will be the EBCDIC translation of the ASCII text string that the Internet routine will return.

To do this you need to so the following:

1) Use a TRT of the EBCDIC input string to verify that all the characters have valid ASCII codes. The table would have x'00' if the code can be mapped to ASCII and x'ff' if not. Hitting any of the x'ff' entries means problems. 2) MVC the string to a workarea and use TR to convert to ASCII (use a EBCDIC->ASCII Table).
3) Pass the workarea to the routine.
4) The result while EBCDIC should be the same display TEXT as that put out by the Internet routine. If you need the ASCII version (as opposed to just displaying it) you need to use the same EBCDIC->ASCII table as was used in Step 2 above to get the ASCII version of the Base64 string - IOW: Redo Step 2 moving the Base64 output to the workarea.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to