[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Ftpapi] YAJL -



Oh wait, I see it now.  using a DS that is.

But still, seeing the JSON would help I would think.

On Sun, Nov 1, 2020 at 12:23 PM Brad Stone <bvstone@xxxxxxxxx> wrote:
actually, it looks like he's not using either.. just spinning through the JSON.. which on my end is missing from the post.  That would help to see that.  :)

I just helped someone with something like this with a double array.  It was messy but worked.

On Sun, Nov 1, 2020 at 10:47 AM Jon Paris <jon.paris@xxxxxxxxxxxxxx> wrote:
It would be helpful to see the DS you are using and the relevant JSON.

P.S. Since you are apparently loading the JSON into a DS, why not just use DATA-INTO with the YAJL-INTO parser?



On Nov 1, 2020, at 9:48 AM, Georgeann Rybak <georgeann.rybak@xxxxxxxx> wrote:

I am able to read the information within the ‘data’ with the code below.  My issue is the ‘extras’ is a data structure within the ‘data’ data structure. 
 
I have tired to access the information via result.list.extras(i) and that does not work. 
 
Do I need to change ‘node’ and ‘list’?
 
Thanks for any help.
 
node = YAJL_object_find(docNode: 'message');    
result.message = YAJL_get_string(node);         
                                                 
list = YAJL_object_find(docNode: 'data');       
                                                 
i = 0;                                          
dow YAJL_ARRAY_LOOP( list: i: node );           
  j = 0;                                        
  Dow YAJL_OBJECT_LOOP( node: j: key: val);     
     exsr load_data;                            
  enddo;                                        
enddo;                
 
Begsr load_data;                                             
 // Use this bring in the fields we need from the Json file  
 // -------------------------------------------------------  
                                                              
 select;                                                     
 when key = 'id';                                             
   Result.list(i).id = yajl_get_string(val);                 
   idsave  = result.list(i).id;                              
 when key = 'referenceId';                                   
   Result.list(i).id = yajl_get_string(val);                  
   refidsave  = result.list(i).id;                           
 when key = 'extras';                                        
 endsl;                                                      
Endsr;                                                                                   
 
Georgeann Rybak
 
SOFTWARE ENGINEER, INFORMATION TECHNOLOGY
THE AMERICAN REGISTRY OF RADIOLOGIC TECHNOLOGISTS®
 
DIRECT PHONE & FAX 651.681.3133 | MAIN PHONE 651.687.0048
1255 NORTHLAND DRIVE, ST. PAUL, MN 55120
 
 
                
-- 
_______________________________________________
Ftpapi mailing list
Ftpapi@xxxxxxxxxxxxxxxxxxxxxx
http://scottklement.com/mailman/listinfo/ftpapi

--
_______________________________________________
Ftpapi mailing list
Ftpapi@xxxxxxxxxxxxxxxxxxxxxx
http://scottklement.com/mailman/listinfo/ftpapi
-- 
_______________________________________________
Ftpapi mailing list
Ftpapi@xxxxxxxxxxxxxxxxxxxxxx
http://scottklement.com/mailman/listinfo/ftpapi