[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Ftpapi] data-into, YAJL parser issues



Hi Scott, it sure helps. I forwarded your email to our system administrator. Hopefully, he can install those ptfs soon. Thank you again for all the help. 

Have a nice day. 

Dennis Liu

On Mon, Sep 23, 2019 at 8:01 PM Scott Klement <sk@xxxxxxxxxxxxxxxx> wrote:

Hi Dennis,

If it helps, the following PTFs would get your RPG compiler, runtime, and previous target levels all up-to-date as of a month or so ago (for IBM i 7.3)

Compiler commands  SI62958
Compiler TGTRLS(*CURRENT)  SI70369
Compiler TGTRLS(V7R2M0)  SI68539 
Compiler TGTRLS(V7R1M0)  SI68538 
QOAR source files  SI67183
Runtime  SI69573 

Installing these would likely be a lot easier than installing all of the PTFs in cum/group packages, but of course, it only brings RPG up-to-date (nothing else).

This would also give you access to the latest features for 7.3, such as the SAMEPOS DS keyword.


-SK


On 9/23/19 5:51 PM, Dennis Liu wrote:
Hi Scott, that is exactly what I meant. You see, you get the value for 'reason'. For me, it came back with blank. I still believe it has something to do with our system where we are missing so many PTFs. I will wait for our system administrator to catch up with our PTFs. Then, I will test again. Unfortunately, they have other high priority works to do. I will keep you posted. Appreciated all your help. 

Cheers, 

Dennis Liu  

On Mon, Sep 23, 2019 at 1:55 PM Scott Klement <sk@xxxxxxxxxxxxxxxx> wrote:

Dennis,

In the debugger, when I check the values of last_assigned_time and reason (of gjs) I see this:

  GJS.LAST_ASSIGNED_TIME = '2017-12-12T11:52:34.922Z      '        
  GJS.REASON = 'Accident / technical difficulties                 ' 

Is that what you were expecting?

-SK


On 9/23/19 12:30 PM, Dennis Liu wrote:
Hi Scott, this is very interesting. I asked our iSeries system engineer to double-check the PTFs (SI67185, SI67187, SI63445, and SI67183) and we confirmed all are applied in our system. I also tried to recompile my program targeting V7R2M0. I still have the same problem. The only possible reason we can think of is that we are very much behind in terms of PTFs, meaning we have many other PTFs that have not applied for the past year or two. 

Anyway, I am glad it worked just fine when you tested. There is one more thing. Even after I use DIM on gJS, it worked. However, the program failed to retrieve the value for 'reason' that is defined as the last element in my data structure. All other values are retrieved correctly, including 'last_assigned_time', but the 'reason' comes back with all blanks. I am not sure if you have the same issue. If you can firm that, that would be great. 

As always, thank you so much for your help. 

Best regards, 

Dennis 

On Sat, Sep 21, 2019 at 2:27 PM Scott Klement <sk@xxxxxxxxxxxxxxxx> wrote:

Hi Dennis,

My apologies, I did not notice the program/json that you attached.  Thank you for re-sending them.

I tried your program and did not have the problems that you describe.  I removed the DIM(1) from gJS, and the program worked without errors.

The DIM on gJS2 is required, however, because "contacts" is an array in the JSON file.   This worked perfectly for me the way you have it coded, which honestly surprised me -- I expected this one to fail because "way_points" is also an array and is in the middle of your path= setting, I figured that would not work, but I was wrong it worked fine without any errors for me.

I do not have access to an actual 7.3 machine, but I tested on a 7.2 machine and on a 7.4 machine with tgtrls(V7R3M0) -- all worked without error.

Perhaps you haven't installed the latest RPG PTFs on your machine?

-SK

On 9/20/2019 11:11 PM, Dennis Liu wrote:
Scott, thank you for your reply. I did attached my progrom and the sample json file I used in the program. If you put the file on your IFS folder, change the folder name in the program. It should run. Also, I want to point out that I don't have the problem #1 when I just run my my program against a simple json string constructed within the program. I did run my json file through an online validation. It is valid. I use this website to do the validation. 

I attach my program and json file again in case it did not go through in the first email. 

 


On Fri, Sep 20, 2019 at 6:46 PM Scott Klement <sk@xxxxxxxxxxxxxxxx> wrote:

Is this mailing list actually working, now?   It had stopped working and was not working for the past 8 month.

Dennis,

I use YAJLINTO every day, and have never run into the problems you are experiencing.  No one else besides you has reported them.  So, you must be doing something differently than the others?

Can you send me an example program (please keep it simple, it doesn't have to do anything useful, it only has to reproduce the problem.  It needs to be something I can run, considering that I don't have your files, programs, etc... so please keep it only to what is necessary.)

Without any idea how to reproduce the problems you're seeing, it's difficult to assist you.

-SK


On 9/20/2019 6:46 PM, Dennis Liu wrote:
Hi Scott, hope you are doing well! I was so excited about the new data-into from IBM and the parser YAJLINTO from YAJL. We recently applied the required PTFs to our system (7.3). I wrote a sample program to play with. But, quickly, I run into some issues:
 
1. I have to define my data structure as an array (dim(n)) even though my json string does not start with a list. I got the error: 
 "15. A call to QrnDiStartArray was made, but the matching RPG variable or subfield is not an array.". 

2. After I changed my data structure to an array, it worked. However, I run into another problem. I am missing the value for the last element from my json string. 
 
3. I also tried to retrieve an object inside the json string using 'path'. Again, I run into an error. I got the following message: 
    Pointer not set for location referenced.                              
    Application error.  MCH3601 unmonitored by QRNXUTIL at statement      
      0000000031, instruction X'0000'.                                    
    Application error.  MCH3601 unmonitored by QRNXUTIL at statement      
      0000000031, instruction X'0000'.                                    
    Unmonitored exception at statement 46500 of procedure DO_START_OBJECT
    Replacement text of message CEE9901 in QCEEMSG in QSYS not valid for  
      format specified.

Here is the snippet of my code:

       clear gJS;

       data-into gJS %data(gIFSFile
        :'doc=file case=convert allowmissing=yes allowextra=yes')
                     %parser('YAJL/YAJLINTO');


       //Retrieve part of the json string based on the path
       clear gJS2;
       data-into gJS2 %data(gIFSFile
        :'doc=file case=convert allowmissing=yes allowextra=yes +
          path=orderIsCancelled/way_points/contacts')
       %parser('YAJLINTO'
              :'{"value_null": "*none*", "document_name": "orderIsCancelled"}'); 


I also attached my program and the json string. 

Appreciate if you give me some advice. Thanks a lot. 

Warmest regards,

Dennis 
 

--
Best regards,

Dennis 刘 春

--
_______________________________________________
Ftpapi mailing list
Ftpapi@xxxxxxxxxxxxxxxxxxxxxx
http://scottklement.com/mailman/listinfo/ftpapi


--
Best regards,

Dennis 刘 春

--
_______________________________________________
Ftpapi mailing list
Ftpapi@xxxxxxxxxxxxxxxxxxxxxx
http://scottklement.com/mailman/listinfo/ftpapi


--
Best regards,

Dennis 刘 春

--
_______________________________________________
Ftpapi mailing list
Ftpapi@xxxxxxxxxxxxxxxxxxxxxx
http://scottklement.com/mailman/listinfo/ftpapi


--
Best regards,

Dennis 刘 春

--
_______________________________________________
Ftpapi mailing list
Ftpapi@xxxxxxxxxxxxxxxxxxxxxx
http://scottklement.com/mailman/listinfo/ftpapi


--
Best regards,

Dennis 刘 春
-- 
_______________________________________________
Ftpapi mailing list
Ftpapi@xxxxxxxxxxxxxxxxxxxxxx
http://scottklement.com/mailman/listinfo/ftpapi