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



I believe this should be done like this:

D docNode s like(yajl_val)
D node s like(yajl_val)
D ids s like(yajl_val)
D arrayNode s like(yajl_val)

D id s 500a varying
D i s 10i 0
D errMsg s 500a varying inz('')

docNode = //Loading the JSON data;

// position node to "data"
node = YAJL_object_find(docNode : 'data');

//position ids to the array
ids = YAJL_object_find(node: 'generatedIds');

//parse the array
dow YAJL_ARRAY_LOOP(ids:i:arrayNode);
id = yajl_get_string(arrayNode);
//process each id value
enddo;

I have a whole bunch of other JSON building and parsing examples here:
http://fieldexit.com/forum/thread?groupid=Prog&forumid=POC

I did format the code in this to fixed width so I hope it comes through
ok. Otherwise you should just be able to copy and paste it into your
editor.

Brad
www.bvstools.com

On Sat, Dec 3, 2016 at 2:16 PM, Nihat Ezer <Nihat.Ezer@xxxxxxxxxxxxxx>
wrote:

Greetings,
The following is JSON data subject to my question:

{"data":{"generatedIds":["4Uz+N55BR2SMxKQWyHOTpA=="]},"
success":true,"error":null,"validations":null }

Using YAJL API by Scott Klement and struggling with parsing the JSON data
returned from a web service cal. I can successfully read the values for the
"data", "generatedIds" and the first and last element of the array. Because
the array element does not have a name, I cannot retrieve its value.

node = YAJL_object_find(docNode : 'data');
node = YAJL_object_find(node:'generatedIds');
node = YAJL_ARRAY_ELEM(node:1);
node = YAJL_object_find(node: ___ );
genId = yajl_get_string(node);

Thanks,
Nihat.
[https://www.avivasa.com.tr/i/Assets/images//otomatik-katilim-imza-1.jpg]<
https://www.avivasa.com.tr/bes-otomatik-katilim-nedir>

Bu e-postanin i?erdigi bilgiler (ekleri dahil olmak ?zere) gizlidir.
Onayimiz olmaksizin ???nc? kisilere a?iklanamaz. Bu mesajin g?nderilmek
istendigi kisi degilseniz, l?tfen mesaji sisteminizden derhal siliniz.
AvivaSA Emeklilik ve Hayat A.S. bu mesajin i?erdigi bilgilerin dogrulugu
veya eksiksiz oldugu konusunda bir garanti vermemektedir. Bu nedenle
bilgilerin ne sekilde olursa olsun i?eriginden, iletilmesinden,
alinmasindan, saklanmasindan sorumlu degildir. Bu mesajin bilinen vir?slere
karsi kontrolleri AvivaSA Emeklilik ve Hayat A.S. tarafindan yapilmistir.
Ancak internet iletisiminde g?venlik ve hatasiz g?nderim garanti
edilemeyeceginden, mesajin yerine ulasmamasi, ge? ulasmasi, i?eriginin
bozulmasi ya da mesajin vir?s tasimasi gibi problemler olusabilir. AvivaSA
Emeklilik ve Hayat A.S. bu tip sorunlardan sorumlu tutulmaz. Bu mesajin
i?erigi yazarina ait olup AvivaSA Emeklilik ve Hayat A.S.'nin g?r?slerini
i?ermeyebilir.

The information contained in this e-mail (including any attachments) is
confidential. It must not be disclosed to any person without our authority.
If you are not the intended recipient, please delete it from your system
immediately. AvivaSA Emeklilik ve Hayat A.S. makes no warranty as to the
accuracy or completeness of any information contained in this message and
hereby excludes any liability of any kind for the information contained
therein or for the information transmission, reception, storage or use of
such in any way whatsoever. This message is scanned for known viruses by
AvivaSA Emeklilik ve Hayat A.S. But Internet communications cannot be
guaranteed to be secure or error-free as information could be intercepted,
corrupted, lost, arrive late or contain viruses. The AvivaSA Emeklilik ve
Hayat A.S. therefore does not accept liability for any errors or omissions
in the context of this message which arise as a result of Internet
transmission. Any opinions expressed in th
is message are those of the author and may not necessarily reflect the
opinions of AvivaSA Emeklilik ve Hayat A.S.
--
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.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.