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



So I have one of those JSON structures that doesn't have root object name.. it looks like this

[
{
"id": "37257",
"recordType": "salesorder",
"External_ID": "10040031",

...more here

I used YAJLGEN (thank you very much) to create my DS. Likewise I'm using YAJLINTO.

YAJLGEN created this template:
dcl-proc readTheJson;

num_jsonDoc int(10) inz(0);
dcl-ds jsonDoc qualified dim(5);
ID varchar(5) inz('');
RECORDTYPE varchar(10) inz('');
EXTERNAL_ID varchar(8) inz('');
.... More here

data-into jsonDoc %DATA( ifsPathname
: 'doc=file case=convert countprefix=num_')
%PARSER( 'YAJLINTO'
: '{ "document_name": "jsonDoc", +
"number_prefix": "YAJL_" }');

So this works if I remove "num_jsonDoc" above the DS. I can deal with this, but was wondering if there's any way to include the counter?

I would like to do
For x = 1 to num_jsonDoc;
Instead of
For x = 1 to %elem(jsonDoc);
(other logic here to handle blank elements)

Just curious.

TIA
Greg

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.