× 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.



Apologies

D rc S 10U 0
D W#TKN S 50a varying
D W#TKN2 S 50a varying

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?



From: Scott Mildenberger <SMildenberger@xxxxxxxxxxxxxxxxxx>
To: "RPG programming on the IBM i (AS/400 and iSeries)"
<rpg400-l@xxxxxxxxxxxx>
Date: 04/06/2015 03:47 PM
Subject: RE: Base64 Decode Help
Sent by: "RPG400-L" <rpg400-l-bounces@xxxxxxxxxxxx>



What are the definitions of your fields W#TKN, W#TKN2?

Scott Mildenberger


-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of
RWesh@xxxxxxxxxxx
Sent: Monday, April 06, 2015 1:05 PM
To: rpg400-l@xxxxxxxxxxxx
Subject: Base64 Decode Help

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:
Replies:

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.