DSXchange: DataStage and IBM Websphere Data Integration Forum
View next topic
View previous topic
Add To Favorites
Author Message
Ramzus
Participant



Joined: 18 Jul 2019
Posts: 4
Location: ste julie
Points: 80

Post Posted: Thu Jul 18, 2019 12:41 pm Reply with quote    Back to top    

DataStage® Release: 11x
Job Type: Parallel
OS: Windows
Additional info: Hiearchical Data stage
Hi everybody
I would like to generate a json file from oracle table,
the first step i did a job to generate a sequential file from oc
the second one, i tryed to compose a json file from sequetial file using Hiearchical Data stage, i prepared a shema json, the problem that my output(json file) still empty
based on ibm example i understood that schema json it could be the first record:

Code:
{
   "product": [

   { "NO_PROD": "10000",
       "NO_VERS_PROD": "32",
     "CD_FAML_PROD": "voy",
     "IND_TAXB": "1",
     "IND_PLAN_OBLG": "0",
     "IND_PREN_DIFF_ASSR_PRIN": "0" ,
     "DT_DEBT_DISP": "2007-12-01",
     "MTN_PRIM_MIN": "25,00" ,
     "DT_CREA": "07-SEP-07 10.08.28.875 AM+0100",
     "CD_UTIL_CREA": "superadmin",
     "NOM_PROD_FR": "Assurance Voyage Ă€ la Carte",
     "NOM_PROD_EN": "Individual Travel Insurance",
     "NOM_PROD_ABRG_FR": "Assurance Voyage Ă€ la Carte",
     "NOM_PROD_ABRG_EN": "Individual Travel Insurance",
     "DT_FIN_DISP": "2007-12-01",
     "DT_ENTR_VIGR": "2007-12-01",
     "DT_FIN_DISP_RENV": "2007-12-01",
     "CLAS": "",
     "SOUS_CLAS": "",
     "CD_MOD_RENV": "",
     "DT_RENV": "",
   
   }
   ]
 }

Help please
Thank you
chulett

Premium Poster


since January 2006

Group memberships:
Premium Members, Inner Circle, Server to Parallel Transition Group

Joined: 12 Nov 2002
Posts: 43011
Location: Denver, CO
Points: 221947

Post Posted: Fri Jul 19, 2019 12:29 am Reply with quote    Back to top    

Welcome aboard.

Thanks for creating your own topic for this discussion. But we're going to keep it all here so I deleted your post on the end of this older JSON discussion which didn't really seem to have a direct bearing on what you are doing or needing help with. Of course, if the original poster wants to chime in here and help out, they are more than welcome to. Wink

As part of trying to help with this, have you worked with JSON files before and just need some DataStage help with them or are they all new? Are you seeing any errors when your job runs? I'm just asking for a friend as I never have worked with them myself, I'm just hoping to get more information out there for whoever has and tries to help. Thanks.

_________________
-craig

The muffin man is seated at the table in the laboratory of the Utility Muffin Research Kitchen reaching for an oversized chrome spoon
Rate this response:  
Not yet rated
eostic

Premium Poster



Group memberships:
Premium Members

Joined: 17 Oct 2005
Posts: 3824

Points: 30833

Post Posted: Mon Jul 22, 2019 10:45 am Reply with quote    Back to top    

As Craig notes, more detail is needed...you need to map the "lists" from your imported JSON (in the Library Manager you can review it, or at the "root" part of the JSON composer).....this is a very difficult stage to learn initially..... browse also any/all of the xml compose or "build/write" XML posts that you can, since it uses the exact same techniques.

Ernie

_________________
Ernie Ostic

blogit!
Open IGC is Here!
Rate this response:  
Not yet rated
UCDI



Group memberships:
Premium Members

Joined: 21 Mar 2016
Posts: 376

Points: 3877

Post Posted: Wed Jul 24, 2019 3:36 pm Reply with quote    Back to top    

for small, non nested, extremely simple markup files, I am often willing to just generate them directly without any parsing/thinking/schema/etc. Its faster, easier to code, etc but its no good if you need to change it a lot over time. Most of this stuff does not change over time though. Just a thought. Once it gets nested or large, you still need to know how to do it right!
Rate this response:  
Not yet rated
Ramzus
Participant



Joined: 18 Jul 2019
Posts: 4
Location: ste julie
Points: 80

Post Posted: Sat Jul 27, 2019 11:49 pm Reply with quote    Back to top    

Thank yu Craig,
I have worked and i work with datastage but never with json, i'm seeing any errors, the json file is generated but is empty.
Thank you
Rate this response:  
Not yet rated
chulett

Premium Poster


since January 2006

Group memberships:
Premium Members, Inner Circle, Server to Parallel Transition Group

Joined: 12 Nov 2002
Posts: 43011
Location: Denver, CO
Points: 221947

Post Posted: Sun Jul 28, 2019 8:22 am Reply with quote    Back to top    

I'm assuming you meant to say "i'm not seeing any errors", yes?

As noted, it's not an easy stage to learn how to use. Experience with the XML equivalent Hierarchical stage would be helpful but I'm guessing that's something else you've not had a chance to work with yet either. Have you involved your official support provider? In your shoes that's what I would be doing along with the research that Ernie noted.

_________________
-craig

The muffin man is seated at the table in the laboratory of the Utility Muffin Research Kitchen reaching for an oversized chrome spoon
Rate this response:  
Not yet rated
Ramzus
Participant



Joined: 18 Jul 2019
Posts: 4
Location: ste julie
Points: 80

Post Posted: Sun Jul 28, 2019 3:09 pm Reply with quote    Back to top    

UCDI wrote:
for small, non nested, extremely simple markup files, I am often willing to just generate them directly without any parsing/thinking/schema/etc. Its faster, easier to code, etc but its no good if you need to change it a lot over time. Most of this stuff does not change over time though. Just a thought. Once it gets nested or large, you still need to know how to do it right!

Thank you UCDI
How you do it to generate directly, how you could choose json file in output?
Rate this response:  
Not yet rated
chulett

Premium Poster


since January 2006

Group memberships:
Premium Members, Inner Circle, Server to Parallel Transition Group

Joined: 12 Nov 2002
Posts: 43011
Location: Denver, CO
Points: 221947

Post Posted: Mon Jul 29, 2019 8:07 am Reply with quote    Back to top    

You wouldn't be choosing anything other than a sequential file. UCDI meant a technique where you build everything in a transformer, all the strings and structures coded by hand so the resulting file looks like a JSON file should look. As noted, the technique is only good for "small, non-nested, extremely simple" files, is that what you have?

_________________
-craig

The muffin man is seated at the table in the laboratory of the Utility Muffin Research Kitchen reaching for an oversized chrome spoon
Rate this response:  
Not yet rated
Ramzus
Participant



Joined: 18 Jul 2019
Posts: 4
Location: ste julie
Points: 80

Post Posted: Mon Jul 29, 2019 11:51 am Reply with quote    Back to top    

chulett wrote:
You wouldn't be choosing anything other than a sequential file. UCDI meant a technique where you build everything in a transformer, all the strings and structures coded by hand so the resulting file looks like a JSON file should look. As noted, the technique is only good for "small, non-nested, extremely simple" files, is that what you have?

I thought that i could generate my json file from my sequential file directly.
Example in my distributor table i have 10330 recors so i couldnt coding by hand. Like i explained in my first post, i tryed to use Composing JSON data by using the JSON Composer, i did my json schema, mapping every think running well but my json output file still empty Sad
Rate this response:  
Not yet rated
UCDI



Group memberships:
Premium Members

Joined: 21 Mar 2016
Posts: 376

Points: 3877

Post Posted: Mon Jul 29, 2019 1:01 pm Reply with quote    Back to top    

right, what I was saying is you can just craft the text you need for small xml/json etc files. Its easier and more efficient than parsing and scheming and whatnot so long as you are ok with having to fix it if the fields change. The markup generation stages are a big hammer and your problem may be a tiny fly.
Rate this response:  
Not yet rated
Display posts from previous:       

Add To Favorites
View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2001, 2002 phpBB Group
Theme & Graphics by Daz :: Portal by Smartor
All times are GMT - 6 Hours