Datastage Scenario?

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
pkll
Participant
Posts: 73
Joined: Thu Oct 25, 2012 9:45 pm

Datastage Scenario?

Post by pkll »

Hi,

I have source is

sno,sname
1,x
1,y
2,y
2,z
3,z

I want target is

sno,sname
1,z
2,x
3,x
3,y

Could you please explain me?
bart12872
Participant
Posts: 82
Joined: Fri Jan 19, 2007 5:38 pm

Post by bart12872 »

It's funny, another guy asked for the same logic yesterday.
viewtopic.php?t=151504
FranklinE
Premium Member
Premium Member
Posts: 739
Joined: Tue Nov 25, 2008 2:19 pm
Location: Malvern, PA

Post by FranklinE »

These queries remind me of a "game" introduced by Martin Gardner in Scientific American, called "Life". It's a primitive graphic representation of the behavior of living cells under experimental controls.

The algorithms needed to automate the game are also based on Cartesian logic (is that the right reference?). I won't go into the details, one can find it easily with your favorite Interwebs search tool. I would relate it here as follows:

Code: Select all

Given a two-dimensional grid with a linear series on each axis, determine from a set of combination pairs which intersections on the grid are present (in the current query, absent) from the set.
It's been forever, but I've seen workable code for that in both Basic and FORTRAN. If one must use this in a DataStage environment, it should be possible to do so in a custom stage running the Basic solution for it. I wonder if using lookups might be possible.

Edit: Create a temporary table with all of the possible combinations. Sort the input data and remove duplicates on the combinations as keys. Set a "present" flag for each input combination. When finished, query the table for all combinations lacking the "present" flag. No loops needed.
Franklin Evans
"Shared pain is lessened, shared joy increased. Thus do we refute entropy." -- Spider Robinson

Using mainframe data FAQ: viewtopic.php?t=143596 Using CFF FAQ: viewtopic.php?t=157872
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

"Edit" part explains the logic well enough although I am confused about "Life : The Game" :wink:
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
asorrell
Posts: 1707
Joined: Fri Apr 04, 2003 2:00 pm
Location: Colleyville, Texas

Post by asorrell »

"Conway's Game of Life" was one of the first serious programming exercises us "Old Guys" had to do in our Computer Science classes back in the 70's and 80's. It used iterative rule-based processing to show how "cells" could multiply and die off in a closed system. By rapidly showing each generation's evolution you'd get interesting patterns that in some cases repeated moves in an infinite wave.

"http://en.wikipedia.org/wiki/Conway's_Game_of_Life"

Note: you'll have to copy / paste the link. The single quote messes up the bulletin board url handling.

Image
My favorite was "The Pulsar".

... and the only thing this has to do with the topic in question is it also uses iterative processing and can have Cartesian products in an unbounded system...
Andy Sorrell
Certified DataStage Consultant
IBM Analytics Champion 2009 - 2020
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

Nice read.
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
Post Reply