× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Good Afternoon

I am utilizing Scott Klement's Base64 decode program in RPGLE but I am
coming across an error that I'm unsure how to resolve at this point.

I didn't have any examples to work with so hopefully my code isn't too far
off.

This is what is in the header file <<<<<<<
*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
* base64_decode: Decode base64 encoded data back to binary
*
* Input = (input) pointer to base64 data to decodet
* InputLen = (input) length of base64 data
* Output = (output) pointer to memory to receive output
* OutSize = (input) size of area to store output in
*
* Returns length of decoded data
* data. If this value is greater than OutSize
* output may have been truncated.
D base64_decode PR 10U 0
D Input * value
D InputLen 10U 0 value
D Output * value
D OutputSize 10U 0 value


This is the implementation of my actual code where I am receiving: RANGE
OF SUBSCRIPT VALUE OR CHARACTER STRING ERROR

I would just like to decode the given character string and view it in my
variable W#TKN2.
I was told that my string in the variable W#TKN was BASE64

*******************************************************************************************
H DFTACTGRP(*NO) BNDDIR('BASE64')
/copy qrpglesrc,base64_h

/free

W#TKN = 'RAzzZdUxv8vITCMacEkcIRk0+18CykzsRnsTDMV1fNM=';

rc = base64_decode( %addr(W#TKN)
: %len(%trimr(W#TKN))
: %addr(W#TKN2)
: %size(W#TKN2));

DSPLY W#TKN2;

*inlr = *on;
RETURN;
/end-free

*******************************************************************************************


Russell Wesh, PMP | Data Integration Specialist
Sumitomo Drive Technologies
Sumitomo Machinery Corp. of America
Tel: +1-757-485-3355 ext. 8633
Cell: +1-757-822-4446
Fax: +1-757-485-7190
www.sumitomodrive.com | How are we doing?



This document should only be read by those persons to whom it is addressed and is not intended to be relied upon by any person without subsequent written confirmation of its contents. Accordingly, Sumitomo Machinery Corporation disclaims all responsibility and accept no liability (including in negligence) for the consequences for any person acting, or refraining from acting, on such information prior to the receipt by those persons of subsequent written confirmation. If you have received this e-mail message in error, please notify us immediately by telephone. Please also destroy and delete the message from your computer. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and/or publication of this e-mail message is strictly prohibited.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 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.