Thank You :-) Happy Now!!

Don Brown

From: "Jon Paris" <>
To: "RPG programming on the IBM i (AS/400 and iSeries)"
Date: 14/01/2019 02:42 AM
Subject: Re: DATA-INTO Json failing
Sent by: "RPG400-L" <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx>

You don't need the count - unless the item is optional.

I coded it originally because you had said it was an array and I had not
spotted that it wasn't. When noted that I just didn't think to mention
that if the item is compulsory then neither the num_ field or the Dim()
are needed. If the item is optional then coding it allows you to avoid
having to use allowmissing - which is always a dangerous option.

Jon Paris

On Jan 12, 2019, at 6:21 PM, Don Brown <DBrown@xxxxxxxxxx> wrote:

Sorry for continuing this discussion but I am still not getting one

Here is a very simple example using just a part of the json string that
am working with.
(Unfortunately this is not just test data - it is from the user
testing environment
and represents exactly what we will get in the live environment!!)

Here is the json;

myjson = '{ +
"refresh_token_expires_in" : "0", +
"api_product_list" : "[P2P Rideshare API Product]",

And the data structure that now works for that json string

dcl-ds aaaaa qualified;
refresh_token_expires_in varchar(10);
num_api_product_list int(5) ;
api_product_list varchar(50) dim(5);

Why do I need a count ( num_api_product_list int(5) ) for the

As you said in your previous response "[P2P Rideshare API Product]" IS

NOT an array
because the square brackets are inside the double quotes.

In case I have oversimplified or by omitting the full json string and/or

data structure i have included
again below.

dcl-ds aaaaa qualified;
refresh_token_expires_in varchar(10);
num_api_product_list int(5) ;
api_product_list varchar(50) dim(5);
num_api_product_list_json int(5) ;
api_product_list_json varchar(50) dim(5);
organization_name varchar(50);
developer_email varchar(50);
token_type varchar(50);
issued_at varchar(20);
client_id varchar(50);
access_token varchar(50);
application_name varchar(50);
scope varchar(50);
expires_in varchar(10);
refresh_count varchar(10);
status varchar(20);

myjson = '{ +
"refresh_token_expires_in" : "0", +
"api_product_list" : "[P2P Rideshare API Product]", +
"api_product_list_json" : [ "P2P Rideshare API Product" ], +
"organization_name" : "onegov", +
"" : "sam@xxxxxxxxx", +
"token_type" : "BearerToken", +
"issued_at" : "1547071634302", +
"client_id" : "WmTFrOi8ZXBa0RBn6Tx2vYd3dnkOgtjj", +
"access_token" : "ePpNwfSoCUosyHpqQJlcK3zAjHeG", +
"application_name" : "2d8ee44d-5621-459a-8e44-7946c8d319dd", +
"scope" : "", +
"expires_in" : "43199", +
"refresh_count" : "0", +
"status" : "approved" +

Don Brown

This email has been scanned by the Symantec Email
For more information please visit
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives

Please contact support@xxxxxxxxxxxx for any subscription related

Help support by shopping at with our affiliate

This thread ...


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

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