|
The requirements are to read / decode a JSON file on the IFS and save the multilanguage value to a column in DB2 table (on i). For now, we just want to be able to view it in ACS SQL to verify and will use it down the road in a JSON we will create. I have reviewed but am not 100% clear this article (https://www.fieldexit.com/forum/display?threadid=321). I was trying to piece together enough from there and in the newest YAJL sample files and I kind of punted when I found that YAJL_stringifyStr seemed to work. It was just slow.
Here is the little bit of code so far..
Val = YAJL_object_find(node1 : 'value');
LANGVAL = %trim(YAJL_stringifyStr(val); // LANGVAL is DB column vargraphic(101) with CCSID 13488
1. How should the column be defined in the table? CSSID? Data type? Length? If I'm wishing it to be 100 en_us characters, should it be defined as 200 due to DBCS?
2. System is not set to CCSID 37, so should job run using CCSID 37?
Language 'Array'....
[
{ "lang" : "de_de", "value" : "No Communication Label" },
{ "lang" : "en", "value" : "No Communication Label" },
{ "lang" : "en_gb", "value" : "No Communication Label"},
{ "lang" : "en_us", "value" : "No Communication Label"},
{ "lang" : "es_es", "value" : "No Communication Label"},
{ "lang" : "fr", "value" : "Aucun libellé de communication"},
{ "lang" : "ja_jp", "value" : "春夏预告系列"},
{ "lang" : "ko_kr", "value" : "No Communication Label"},
{ "lang" : "pt_br", "value" : "No Communication Label"},
{ "lang" : "ru_ru", "value" : "Пре-Коллекция Весна-Лето "},
{ "lang" : "th_th", "value" : "No Communication Label"},
{ "lang" : "zh_cn", "value" : "No Communication Label"},
{ "lang" : "zh_tw","value" : " 春夏 プレコレクション"}
]
-----Original Message-----
From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Scott Klement
Sent: Tuesday, March 5, 2019 12:46 PM
To: rpg400-l@xxxxxxxxxxxxxxxxxx
Subject: Re: Processing Multilanguage Data with YAJL, RPG and a PF
Hello,
Its not clear what problem you're trying to solve or what roadblocks you're hitting. Please take a step back and give us some context?
Thanks!
-SK
On 3/4/2019 9:57 AM, Stephen Piland wrote:
I see prior posts but did not know how to reply to that thread...--
Did someone get this to actually work? I tried what I thought was the simplest path but never could get Brad Stone's example to get past precompile failures on the statement...
Exec sql Declare :value VARIABLE CCSID 1208;
System is running 7.1. I'm going to try the ICONV next but thought there might be a quick trick.
Basically, we are just trying to decode an incoming JSON that has a variety of languages in some element/nodes. Then we want to save to table/file (CCSID 13488/1200 perhaps on that field/column. Down the road, we'll grab that value and create an outbound JSON to send to a REST API.
YAJL Stringify does seem to work but it super slow, so I'm looking at alternatives.
Any suggestions would be greatly appreciated!
This is the RPG programming on IBM i (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxx for any subscription related questions.
Help support midrange.com by shopping at amazon.com with our affiliate link: https://amazon.midrange.com
As an Amazon Associate we earn from qualifying purchases.
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.