Expose DataStage job a service - JSON Format

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
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Just a shot in the dark but to you have an opportunity to manipulate the result string before passing it back out, trim off the parts you don't need?
-craig

"You can never have too many knives" -- Logan Nine Fingers
DataStageRocker
Premium Member
Premium Member
Posts: 9
Joined: Wed Apr 01, 2015 8:53 am
Location: United States

Post by DataStageRocker »

Thanks for your reply. DataStage job is not populating the "results" key word. As per IBM support note - the "results" key is being populated for JSON format binding. Is there an option to drop/uncheck the "results" header in the Information Services Directory client?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Ah. That should probably be a support question then.
-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 »

The JSON payload format is fixed --- meaning not very adjustable...and is a convenience of doing the binding.

The simplest thing to do is to have your developers who are receiving the payload use what they are getting and adjust things on their side after they receive it.

The reason the "result" is set up as you see is that it is allowing for the option to pass an entire "array" (the JSON square brackets []), because the Job might be sending 100 rows instead of just one.

Of course, there are lots of ways you could do this.....so....if you REALLY need a different payload, you might just want to build it yourself.

This is easier said than done, but if the payload you need is fairly simple like this one, and only one row, you can build it very easily in a Transformer Derivation.

It's been awhile since I've looked at the Application builder, but look in your bindings for the "Text over HTTP" binding. It was designed exactly for this purpose. It basically says "just blindly pass along, via HTTP, whatever DataStage gives me".

So.....you can have a Transformer stage as the last thing prior to ISDOutput, and in that Stage, pass out a longvarchar .....and in the derivation, bring in your columns from your upstream links and concatenate them any way you need and want to manually build the exact JSON string that you want ....and then feed ONLY that single longvarchar column into ISDOutput.

Ernie
Ernie Ostic

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