DATA-Into for JSON

Discussions relating to the ScottKlement.com port of the open source YAJL JSON Reader/Generator. This includes the YAJL tool as well as the YAJLR4, YAJLGEN, YAJLINTO and YAJLDTAGEN add-ons from ScottKlement.com. http://www.scottklement.com/yajl/
Post Reply
bobgentile
Posts: 4
Joined: Tue Apr 22, 2025 3:15 pm

DATA-Into for JSON

Post by bobgentile »

I have read everything and I still can not get this JSON to load into the RPG Program is should be loading but I keep getting the error mesage

Preparation for XML parsing failed with message CPE3025

Here is the code

Code: Select all

dcl-ds claim_data qualified;
           ClaimNumber      zoned(10);
           DateReported      char(32);
           dcl-ds Insured;
             L1_PolicyNumber     char(20);
             L1_PolicyType       char(3);
             L1_LoanNumber       zoned(7);
             L1_CompanyNumber    zoned(5);
             L1_CustomerNumber   zoned(7);
             L1_TransferCode     zoned(1);
             L1_PolicyStartDate  char(10);
             L1_PolicyExpireDate char(10);
             L1_FirstName        char(25);
             L1_LastName         char(30);
             L1_HomePhone        char(10);
             L1_LocationAddress1 char(40);
             L1_LocationAddress2 char(40);
             L1_LocationCity     char(26);
             L1_LocationState    char(2);
             L1_LocationZip      char(10);
             L1_LocationCountry  char(3);
             L1_LocationCounty   char(30);
             L1_MailingAddress1  char(40);
             L1_MailingAddress2  char(40);
             L1_MailingCity      char(26);
             L1_MailingState     char(2);
             L1_MailingZip       char(10);
             L1_MailingCountry   char(3);
           end-ds;
           dcl-ds Loss;
             L2_TemporaryClaimNumber  zoned(10);
             L2_LossType          char(10);
             L2_DateOfLoss        char(10);
             L2_ReportedBy        char(40);
             L2_LivingInHome      char(75);
             L2_Whereabouts       char(75);
             L2_AdditionalCoverage char(75);
             L2_OtherPhone         char(10);
             L2_OtherPhoneExt      char(6);
             L2_OtherPhoneCont     char(30);
             L2_Email              char(50);
             L2_PoliceOrFireDepartment  char(20);
             L2_CalledBy           char(30);
             L2_DetailsOfLoss      char(700);
             L2_PersonalEffectsDamage char(1);
             L2_AdjStructureDamage    char(1);
           end-ds;
             dcl-ds Claimant;
             L3_Name               char(30);
             L3_Address1           char(40);
             L3_Address2           char(40);
             L3_City               char(26);
             L3_State              char(2);
             L3_Zip                char(10);
             L3_Country            char(3);
             L3_HomePhone          zoned(10);
             L3_WorkPhone          zoned(10);
             L3_Age                zoned(3);
             L3_DateOfBirth        char(10);
             L3_Employer           char(30);
             L3_Position           char(30);
             L3_SpanishSpeaker     char(5);
             L3_AdditionalComments char(700);
           end-ds;
         end-ds;

         dcl-s json_file_path  char(100);


         json_file_path = '/policy/homeowners/inbound/LossReport_2400005552';
         data-into claim_data %data(json_file_path : 'case=any +
                                  allowMissing=yes +
                                  allowExtra=yes +
                                  doc=file')
         %parser('YAJLINTO' : '{"document_name": json_file_path} ');
Scott Klement
Site Admin
Posts: 872
Joined: Sun Jul 04, 2021 5:12 am

Re: DATA-Into for JSON

Post by Scott Klement »

Type this;

Code: Select all

DSPMSGD CPE3025
What does the message say?
bobgentile
Posts: 4
Joined: Tue Apr 22, 2025 3:15 pm

Re: DATA-Into for JSON

Post by bobgentile »

I have done that already, I get no such path of directory , but the path does exist. see below
image001.png
image001.png (28.65 KiB) Viewed 678 times
mlazarus
Posts: 1
Joined: Thu Jul 29, 2021 3:03 am

Re: DATA-Into for JSON

Post by mlazarus »

You don't have the .json extension in your path/file name.
bobgentile
Posts: 4
Joined: Tue Apr 22, 2025 3:15 pm

Re: DATA-Into for JSON

Post by bobgentile »

Adding the .json to the end resolved the CPE3025 error now I am getting a error in the parsing

Message . . . . : Error CPF9897 occurred while running the program or
procedure for the DATA-INTO operation.
Cause . . . . . : Program or procedure 'YAJLINTO' for the DATA-INTO
operation failed with error message CPF9897. *N indicates that the program
or procedure is a procedure pointer.
Recovery . . . : Check the job log for a complete description of message
CPF9897, and contact the person responsible for program maintenance.

Job Log Message
1004: Parser options are not valid JSON!
Error CPF9897 occurred while running the program or procedure for the
DATA-INTO operation.
Error CPF9897 occurred while running the program or procedure for the
DATA-INTO operation.
Unmonitored exception at line 115
bobgentile
Posts: 4
Joined: Tue Apr 22, 2025 3:15 pm

Re: DATA-Into for JSON

Post by bobgentile »

What is missing or wrong, with no answer from anyone did I actual come across and error no knows about. Find this hard to believe
Scott Klement
Site Admin
Posts: 872
Joined: Sun Jul 04, 2021 5:12 am

Re: DATA-Into for JSON

Post by Scott Klement »

This is not valid:

Code: Select all

%parser('YAJLINTO' : '{"document_name": json_file_path} ');
This code makes no sense at all. It isn't valid JSON. I think your intent was to put the IFS pathname here, but... that isn't what this option is for. This is the name of the document element within your JSON, not a file name.

Unless there's something going on here that you haven't explained, you don't need this. Just do this:

Code: Select all

%parser('YAJLINTO');
Post Reply