|
Something like this?
myvar = jsonToField('jsonvar1');
On Sat, Aug 12, 2017 at 5:19 PM, Maria Lucia Stoppa <mlstoppa@xxxxxxxxx>
wrote:
Yes, as I said we are already and successfully using YAJL in manyprograms
which deal with every single JSON object naming it explicitly.which
What I am trying to do is to generalize the process making a routine
has a data structure and a JSON as input and can couple every JSON pairI
assigning the value to the corresponding variable in the data structure.
2017-08-12 17:10 GMT+02:00 Jon Paris <jon.paris@xxxxxxxxxxxxxx>:
I'm pretty sure that YAJL was what she was talking about n the originalmlstoppa@xxxxxxxxx>
post Henrik.
Jon Paris
www.partner400.com
www.SystemiDeveloper.com
On Aug 12, 2017, at 10:38 AM, Henrik Rützou <hr@xxxxxxxxxxxx> wrote:
Hi Maria,
You should take at look at YAJL that is a C service program that
reads/writes JSON.
Scott Klement has made a RPG-wrapper around it
http://www.scottklement.com/yajl/
More on reading JSON in RPG:
https://www.nicklitten.com/rpg-example-reading-json-using-yajl-ifs/
On Sat, Aug 12, 2017 at 4:07 PM, Maria Lucia Stoppa <
wrote:
Henrik,
I know your points are true and that's how we have done so far, but
amdifferent
trying to figure out a general routine to be copied in many
structureprograms so variable's name can't be hard coded.
Furthermore, JSON structure doesn't necessary reflects data
tovariablefields order, only names and types in order to be valued when a
JSONincludewith the same name and of the same type is present.
2017-08-12 15:45 GMT+02:00 Henrik Rützou <hr@xxxxxxxxxxxx>:
It is generally a very bad idea to map JSON to a datastructure (or
anything) without using
the variable name's since the whole idea in JSON is that you may
mlstoppa@xxxxxxxxx>or
exclude
variables and beside that present them in a random sequence.
On Sat, Aug 12, 2017 at 9:12 AM, Maria Lucia Stoppa <
wrote:
Hello,
I am new to this forum, but I have done some research related to
and
couldn't find anything similar to my issue.
I am working on a proof of concept to code new programs in order
singleparse
the only received parameter formed as a JSON object into a datastructure.
I explain it better: previously, all our programs received a
in*entryparameter defined as an external data structure, so as soon as
plist
operation code is executed the data structure and all the fields
itcommon
were
filled in and made available for programs to use them (quite
membersolution). External data structure are defined as PF without
thatandas
can
be used by any program that need to call the one which received it
a
parameter to perform a specific function.
Now we are moving our ERP's graphic interface to web: it means
ato
webprogram call can be executed by a store procedure called either by
toquickapplications or by RPG programs. To serve the purpose of having a
programsUI
response, parameters are passed coded in a JSON object and new
SK'shave been coded to parse JSON input parameter field by field using
nested)JSON APIs (thanks!).coding a
I am guessing whether I can expand and generalize this behavior by
general routine which takes an external definition of JSON (even
structure and assigns each object's name found into JSON parameter
andits
corresponding variable name's value.
My nightmares are: firstly, today's external DS are one level only
I
can't figure out how to represent nested levels; secondly how to
dynamically associate the value of JSON pair to its corresponding
variable's value according to its type.
One general idea might be to code some external D specifications
beaffiliate
elementused
through /COPY option, which represent JSON structure in terms ofqualified
names and types, array included. Then JSON objects can be read
explicitlyby
element but how can I address the right DS variable without
otherwrite its name?
Can you suggest me some technique I haven't explored yet or any
affiliateaffiliateway
(RPG400-L)to approach the problem?
Thank you
--
Maria Lucia Stoppa
mlstoppa@xxxxxxxxx
--
This is the RPG programming on the IBM i (AS/400 and iSeries)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://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
(RPG400-L)link: http://amzn.to/2dEadiD
--
Regards,
Henrik Rützou
http://powerEXT.com <http://powerext.com/>
--
This is the RPG programming on the IBM i (AS/400 and iSeries)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://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
(RPG400-L)link: http://amzn.to/2dEadiD
--
Maria Lucia Stoppa
mlstoppa@xxxxxxxxx
--
This is the RPG programming on the IBM i (AS/400 and iSeries)
affiliatemailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://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
(RPG400-L)link: http://amzn.to/2dEadiD
--
Regards,
Henrik Rützou
http://powerEXT.com <http://powerext.com/>
--
This is the RPG programming on the IBM i (AS/400 and iSeries)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxquestions.
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxx for any subscription related
Help support midrange.com by shopping at amazon.com with our
(RPG400-L)link: http://amzn.to/2dEadiD
--
This is the RPG programming on the IBM i (AS/400 and iSeries)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://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: http://amzn.to/2dEadiD
--
Maria Lucia Stoppa
mlstoppa@xxxxxxxxx
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://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: http://amzn.to/2dEadiD
--
Regards,
Henrik Rützou
http://powerEXT.com <http://powerext.com/>
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://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: http://amzn.to/2dEadiD
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.