× 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 All,

I am planning to add logic in the DATA-INTO Parser Program, before
populating the value into Data Structure, I need to verify the length of
the fields to validate whether any truncation is happening.

For example

dcl-ds Ds_Input;
name char(5);
number zoned(4:0);
end-ds;

data = '{"name": "David John","number": 123}';
data-into Ds_Input %data(data:dataOption) %parser('mpParser':userParm);

In the above example, the name attribute is the character of length 5 but
the value will be 10 characters. I want to validate this in the Parser
Program.

Is it possible to get the attribute inside the parser program like the
attribute of the field "name" is a character of length 5 and the attribute
of a field "number" is numeric of length 4 with 0 decimal places when
parsing field by field?

Regards,
Suren

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.