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



Hello,

The TRIM feature of DATA-INTO (or XML-INTO) removes these extra blanks.   This has nothing, specifically, to do with YAJLINTO -- it is part of RPG, not part of YAJLINTO.

Try this:

DATA-INTO input %DATA(json_doc: 'trim=none') %PARSER('YAJLINTO');

The TRIM feature is removing the spaces, so specifying TRIM=NONE will solve the problem.

-SK


On 9/29/2020 2:21 AM, Suren K wrote:
Hi Everyone,

I am using Scott Klement's DATA-INTO parser program YAJLINTO for parsing
the JSON Document into a Data structure. I came across an issue which I
wanted to know whether anyone else came across the same issue or do we have
a solution for that?

For Example
JSON Document:
{
"name" : "abcd efgh"
}
Data Strcuture
Dcl-ds input;
name char(100);
end-ds;

I have 4 blank spaces between the value "abcd" and "efgh", after doing the
DATA-INTO i am getting the value in the data structure field as name =
"abcd efgh". 4 blank spaces automatically converted into a single
blank space.

I tried debugging the code YAJLINTO, we are passing the correct value (with
4 blank spaces) to QrnDiReportValueCCSID procedure, i don't know whether
the value is getting converted.

Anyone come across a similar scenario or have we already discussed this and
I missed the conversation?

Any help will be very much appreciated.

Regards,
Surender K

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.