|
Bradley,--
It is a web service call using RXS-XML library the whole JSON
Document comes back in a string.
With I then I do this code.
But I want the array element node "VAL" to be logged not docnode.
docNode = yajl_buf_load_tree(%addr(gXmlResponse:*data) :
%len(gXmlResponse) : JsonErrMsg);
Node = YAJL_object_find(docNode : 'found');
if YAJL_IS_TRUE(Node);
//
// Update NextPage
//
chain (Subscription_P) ofsupd01 ofsupd01Ds;
if not %found(ofsupd01);
exsr Exitpgm;
endif;
Node = YAJL_object_find(docNode : 'nextPage');
nextPage = YAJL_get_string(Node);
ofsupd01Ds.nextPage = nextPage;
ofsupd01Ds.LastPollDate = %dec(%date():*cymd);
ofsupd01Ds.LastPollTime = %dec(%Time():*ISO);
ofsupd01Ds.LastPollStatus = 'G';
update ofsup01f ofsupd01Ds;
items = YAJL_object_find(docNode: 'items');
i = *zeros;
dow YAJL_ARRAY_LOOP( items : i: val );
Node = YAJL_object_find(Val : 'eventType');
eventType = YAJL_get_string(Node);
clear oftrtv01Ds;
chain (Subscription_P : eventType) oftrtv01 oftrtv01Ds;
if %found(oftrtv01);
if oftrtv01Ds.Program <> 'NA' and oftrtv01Ds.status = 'A';
monitor;
writeJobLog('Calling ' + %trim(eventType) + ' ' +
%trim(oftrtv01Ds.Program) + X'25');
program(eventType : val );
on-error;
writeJobLog('*** ERROR *** Calling ' + %trim(eventType) + ' ' +
%trim(oftrtv01Ds.Program) + X'25');
endmon;
endif;
endif;
enddo;
endif;
Val is the one I want to convert to a string which is an Object not a
string .
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.