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



In regard to easy-to-read output format, I ended up producing a columnar
report for end users as opposed to just making the JSON "pretty".

Since JSON is oft-times hierarchical, I decided to show the "path" to each
node in a traditional directory format, along with the "node type",
"nesting level", and "value".

http://rd.radile.com/rdweb/info3/iui20/main.html

The report is generated by an RPG utility, which generates the report is as
follows:

docNode = jsnParseBuf(%addr(json_buffer):%len(json_buffer));

dow jsnForEach('/');
if jsnNodeInfo();
exsr output_report;
endif;
enddo;

jsnParseBuf() generates a node if you pass the address and length of a JSON
buffer.

jsnForEach() scans through each node in the tree.

jsnNodeInfo() transforms the JSON node into an RPG data structure.

output_report is an RPG subroutine that moves data structure subfields to
the "screen"




On Tue, Oct 27, 2020 at 2:10 PM Jack Prucha <Jack.Prucha@xxxxxxx> wrote:

I want to present a JSON payload to the user in an easy-to-read format.
Output like JSONFormatter.org. Linking to a web site is a non-starter so
I'm searching for something iSeries based.

I have Scott's YAJL software installed and am using it with Data-Into.
However, I don't see an example in his thorough documentation to take any
JSON and pretty up the formatting for human viewing. There's a CLE pgm in
his YAJLLIB72 called JSON_Refmt but I can't figure it out.

Most RPGLE JSON open source I see is designed to create or disassemble
JSON - not display it.

Any suggestions?

TIA
Jack






[CFNC]

This email, including any documents, files, or previous email messages
attached to it, has been sent from an email account of College Foundation
Inc., (CFI) and may contain confidential, proprietary, or legally
privileged information belonging to CFI. If you are not the intended
recipient, any dissemination, distribution, or copying of this email or its
attachments is strictly prohibited. If you have received this email in
error, please immediately notify the sender by email and destroy the
original email and any attachments.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com


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.