ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

YAJLINTO error ; Reason Code 14

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • YAJLINTO error ; Reason Code 14

    Hello,

    I have a JSON message where a variable could alternatively contains a value or a Json string itself.


    This is the RPGLE Data structure to MAP json data.


    image.png

    In the example below everything works fine because "name" and "value" are properly mapped into the RPGLE data structure

    image.png

    In this example below "value" contains a Json string itself named "daterange".

    There ia an extra level and I would like to parse "value" as a standard rpgle variable.
    I will then scan "value" variable for "{daterange:" value and from there extract "endDate" and "startDate" via a new RPGLE structure.



    image.png

    I would like to know if this is possibile via YAJLINTO parser.


    JSON FIRST EXAMPLE

    {
    "username": "ADMIN",
    "companycode": "MVS",
    "cmdid": 10000,
    "lang": "it",
    "filtersvalue": [
    {
    "name": "cmd_from",
    "value": 1
    },
    {
    "name": "cmd_to",
    "value": 999999
    }
    ]
    }

    JSON SECOND EXAMPLE


    {
    "username": "ADMIN",
    "companycode": "MVS",
    "cmdid": 70050,
    "lang": "it",
    "filtersvalue": [
    {
    "name": "period",
    "value": {
    "dataRange": {
    "startDate": "Fri Dec 01 2023 00:00:00 GMT+0100 (Central European Standard Time)",
    "endDate": "Tue Jan 02 2024 00:00:00 GMT+0100 (Central European Standard Time)"
    }
    }
    }
    ]
    }​

    Thank you,

    Giovanni
    Attached Files

  • #2
    As near as I can tell, this is the same discussion as this thread https://code400.com/forum/forum/iser...reason-code-14

    Everyone: Please reply to the other thread. It's much easier than trying to follow a conversation across multiple threads.

    Comment

    Working...
    X