×
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.
That sounds like a winner. I checked the Db2 SQL ref, and it didn't have anything about Base64 encoding (except as an XML parameter). Thank you
-----Original Message-----
From: David Gibbs [mailto:david@xxxxxxxxxxxx]
Sent: Friday, August 17, 2018 9:09 AM
To: RPG programming on the IBM i (AS/400 and iSeries) <rpg400-l@xxxxxxxxxxxx>
Subject: Re: Base64 binary in JSON
On 8/17/2018 8:52 AM, Justin Taylor wrote:
I've been tasked with generating a JSON document that contains a PDF
file. The PDF file must be Base64 encoded. I figure I can use the
IFS API's to read in the PDF file, but I'm not sure about how to get
it Base64 encoded.
The process is in RPG, but I'd be open to anything that can be
practically called from RPG as well.
You can use the SQL function BASE64ENCODE.
exec sql set :encodedField = SYSTOOLS.BASE64ENCODE(:VarcharField);
david
--
David Gibbs
midrange.com
IBM i on Power Systems: For when you can't afford to be out of business!
I'm riding 615 miles (Yes, you read that right) in the American Diabetes Association's Tour de Cure to raise money for diabetes research, education, advocacy, and awareness. You can make a tax deductible donation to my ride by visiting
https://lsteml.diabetessucks.net.
See where I get my donations from ... visit
https://lsteml.diabetessucks.net/map for an interactive map (it's a geeky thing).
I may have diabetes, but diabetes doesn't have me!
As an Amazon Associate we earn from qualifying purchases.