Import JSON files

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
RK72
Participant
Posts: 154
Joined: Wed Sep 29, 2010 4:10 pm

Import JSON files

Post by RK72 »

Hi,

I am new to XML or JSON files.

I got one JSON file from source system.

Could you please help me how to import metadata and read the data
from JSON files.

Thanks in advance.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Is this question really related to WebSphere Transformation Extender?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
RK72
Participant
Posts: 154
Joined: Wed Sep 29, 2010 4:10 pm

Post by RK72 »

This is regarding to DataStage.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

"DataStage TX" is no longer part of DataStage, and is properly called WebSphere Transformation Extender, or WebSphere TX.

Your question properly belongs in the DataStage Enterprise Edition forum.

If you don't move it, Craig surely will.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Done.
-craig

"You can never have too many knives" -- Logan Nine Fingers
RK72
Participant
Posts: 154
Joined: Wed Sep 29, 2010 4:10 pm

Post by RK72 »

I will move this post to DataStage Enterprise Edition forum.

Could you please let me know how to import metadata and read the data from JSON files.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I've already moved it. This is the correct forum.

So... these JSON files? First thing I'd ask is what you need to do with them other than "read" them? Knowing what your goal / target is here will help us help you.
-craig

"You can never have too many knives" -- Logan Nine Fingers
RK72
Participant
Posts: 154
Joined: Wed Sep 29, 2010 4:10 pm

Post by RK72 »

We had an exisitng job which will read and parse the XML file then run through the DS US postal validation and load into MQ.

Now the source system team is sending JSON files instaed of XML files. My work is read and parse the JSON files, after that the remaining process is same.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Looks like rolling up your own mechanism to parse them would be... painful. Can you get your hands on a JSON Parser? I would imagine it could be leveraged via an External Source stage and seems to me it would be the quickest / most reliable way to accomplish this task.
-craig

"You can never have too many knives" -- Logan Nine Fingers
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

JSON is very much "like" xml, but is not.......it would be nice to use the xml stages for this, but alas, it is not possible.

Java has all kinds of libraries to process JSON.....my suggestion would be to start looking at JavaPack and write your own class to decipher this JSON and send it to your output link....or (possibly) investigate a way in the java class to "zap" all the tags and indicators in the JSON structure to XML and then pass the resulting structure to your existing xml stage....

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
Post Reply