|
On Sep 14, 2023, at 4:20 PM, Suren K <suren7437@xxxxxxxxx> wrote:
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
--
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.
As an Amazon Associate we earn from qualifying purchases.
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.