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



Hi Scott,

Thanks a lot for your email. I tried using trim = none, it worked:)!!!!

Thanks a lot for helping me out.

Regards,
Surender K

On Tue, Sep 29, 2020 at 7:54 PM Scott Klement <rpg400-l@xxxxxxxxxxxxxxxx>
wrote:

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
--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-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.