Parsing JSON file using Hierarchical Stage

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
tan1111
Participant
Posts: 4
Joined: Thu Nov 20, 2008 11:52 am
Location: pune

Parsing JSON file using Hierarchical Stage

Post by tan1111 »

Dear All,

I am pasting the body here of a JSON, which I was unable to parse in DS 11x, using Hierarchical Stage.

Code: Select all

{"PersonContactMethodBObj": [
              {
                "ContactMethodUsageValue": "BUSINESS-FAX",
                "TCRMContactPersonBObj": [
                  {
                    "Name": "Jack",
                    "Age": "21"
                  },
                  {
                    "Name": "Julie",
                    "Age": "FAX_new"
                  }
                ]
              },
              {
                "ContactMethodUsageValue": "BUSINESS-PHONE",
                "TCRMContactPersonBObj": {
                  "Name": "Ishara",
                  "Age": "18"
                }
              },
            ]
}

Please let me know, if anyone could parse it.
Would be of great help.

Thanks in advance,
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You were 'unable to parse' this in what sense - you are getting errors? Not sure how to approach it? Not getting proper output?

Detail for us what you've tried and the issues you are seeing.
-craig

"You can never have too many knives" -- Logan Nine Fingers
qt_ky
Premium Member
Premium Member
Posts: 2895
Joined: Wed Aug 03, 2011 6:16 am
Location: USA

Post by qt_ky »

Yes, you need to share actual error messages...

In this case the error is plainly visible. You can also google "JSON validator" and try a site like this one: http://jsonlint.com/

Paste it in and validate. It will highlight the error.

Near the end you have }, ] } and you can see that there's no value after that last comma. It's invalid JSON.
Choose a job you love, and you will never have to work a day in your life. - Confucius
Post Reply