× 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 and Everyone,

I am adding additional changes in YAJLINTO Parser for adding two generic
validations (Data Type Validations and Data Truncation Validations). By
adding this i don't want to repeat the same logic in all the programs where
i am using DATA-INTO for parsing JSON Document.

The Logic which i am using are
1) I have added one more parser option "File_Name" = EDS Name for the Data
Structure which i am using for DATA-INTO.
2) I am passing the Parser option in a Work Variable (Length i am setting
as example 10000 Character) Example as below
Wrk_PsrOpt = '{ "document_name": "json", ' +
' "value_true": "1", ' +
' "value_false": "0", ' +
' "file_name": "CFEIAUP06" }';

data-into(E) DS01_DtaStr %DATA(Json_Var:Wrk_Opt)
%PARSER('YAJLINTO':Wrk_PsrOpt);
3) I am getting the EDS File name inside the Parser Program YAJLINTO and
fetching the File Field attributes. Based on the Json Field name and Value
parsed inside the YAJLINTO (In routines do_string, do_number, etc...) I am
doing the required validations and populated the Warning Messages and Error
Messages into an Array.
4) Before YAJLINTO Program Exit, i am populating the Message Array data
into the Address of Parser Parameter (PARM.USERPARM which has the address
of the Parser Options)
5) Once the data-into line executed from my main program, i am getting the
populated Error and Warning Messages details in the Wrk_PsrOpt Field.

I have below clarifications
1) I am using the Parser Option field as a communication area for sending
some details from the Parser program to the Main program. Is this the right
way or we have any other way to communicate?
2) What is the maximum field length i can pass as a Parser Option? Since
Data-Into is sending the address as a parameter so i am thinking there will
not be any limit (We can send up to Maximum character field length)

Could you please let me know your suggestions on this one?

Regards,
Surender K

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.