Page 1 of 1

Import JSON files

Posted: Tue Jul 24, 2012 4:13 pm
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.

Posted: Tue Jul 24, 2012 4:17 pm
by ray.wurlod
Is this question really related to WebSphere Transformation Extender?

Posted: Tue Jul 24, 2012 4:26 pm
by RK72
This is regarding to DataStage.

Posted: Tue Jul 24, 2012 4:31 pm
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.

Posted: Tue Jul 24, 2012 4:45 pm
by chulett
Done.

Posted: Tue Jul 24, 2012 4:48 pm
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.

Posted: Tue Jul 24, 2012 5:14 pm
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.

Posted: Tue Jul 24, 2012 5:38 pm
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.

Posted: Tue Jul 24, 2012 5:53 pm
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.

Posted: Wed Jul 25, 2012 6:14 am
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