List Items in a Hierarchical Stage

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
MrBlack
Participant
Posts: 125
Joined: Wed Aug 08, 2012 8:57 am

List Items in a Hierarchical Stage

Post by MrBlack »

I'm new to the Hierarchical Stage and I'm new to JSON so I'm looking for help how to configure this stage correctly.

This is the desired JSON output that I'm trying to get DataStage to make:

Code: Select all

{
	"properties": {
		"Project_Name": "test",
		"Job_Name": "test",
		"Status": "test"
	},
	"recipients": [{
		"targetName": "test"
	}]
}
Unfortunately I don't have schema so I'm having to reverse engineer one, this is what I have come up with so far:

Code: Select all

{
	"properties": 
	{
		"Project_Name": "string",
		"Job_Name": "string",
		"Status": "string"
	},
	"recipients": 
	[{
		"targetName": "string"
	}]
}
The part that I'm stuck on is the square brackets "[" between recipients and targetname. From what I've read online, the brackets mean this is an array or list of items. How do I make and map a list in the assembly editor? It doesn't allow me to mapped a string, it wants a list. In my situation I'll never have more than one target name but the assembly editor still wants a list of 1.

If I remove the bracket from the schema, I can get things to work but the output is missing the required bracket. So I feel as if I'm close if I can just figure out how to get the bracket in the final output.
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

....you can just import "the" desired JSON into the Library manager..."as is"....start with a reasonably complete one --- if it has an "array", be sure that it has multiple values in the sample. You don't need to create a "schema"....just a good, fully populated sample.

Ernie
Ernie Ostic

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