Logic needed

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
HemaV
Participant
Posts: 63
Joined: Wed Jan 09, 2008 1:38 am
Location: Bangalore

Logic needed

Post by HemaV »

Input:
employee_id, salary
-------------------
10, 1000
20, 2000
30, 3000
40, 5000

output:
employee_id, salary, next_row_salary
------------------------------------
10, 1000, 2000
20, 2000, 3000
30, 3000, 5000
40, 5000, Null

I need a Datastage job to get this output.
zulfi123786
Premium Member
Premium Member
Posts: 730
Joined: Tue Nov 04, 2008 10:14 am
Location: Bangalore

Post by zulfi123786 »

interview question :wink: ?
- Zulfi
SURA
Premium Member
Premium Member
Posts: 1229
Joined: Sat Jul 14, 2007 5:16 am
Location: Sydney

Re: Logic needed

Post by SURA »

couple of years before, this logic was asked in an interview to me!!

Fine you can sort the data in desc and use stage variable in the TFM
Thanks
Ram
----------------------------------
Revealing your ignorance is fine, because you get a chance to learn.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Good luck getting the null in the final row!
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
HemaV
Participant
Posts: 63
Joined: Wed Jan 09, 2008 1:38 am
Location: Bangalore

Re: Logic needed

Post by HemaV »

SURA wrote:Fine you can sort the data in desc and use stage variable in the TFM
can you please give tell me how to use the stage variable in the transformer
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Re: Logic needed

Post by priyadarshikunal »

You really need to read the documentation of transformer and stage variables first.
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

So you haven't used stage variables yet? Do you have any experience with other ETL tools? They are variables that are local to the transformer and are (for all practical purposes) identical to variable ports in Informatica, if that helps at all.

If it doesn't, is there anyone you work with who could give you a quick tutorial? Otherwise, as noted, they are discussed in the Defining Local Stage Variables section of the Parallel Job Developer's Guide (parjdev.pdf in your version).
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply