How can we get records in first and second alphabetically

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
RK72
Participant
Posts: 154
Joined: Wed Sep 29, 2010 4:10 pm

How can we get records in first and second alphabetically

Post by RK72 »

Hi All,

I have two coulmns column 1 and column 2, i need to get the records in first and second alphabatical order

1)Select 'column1' or 'column2 'based on which value populated comes first alphabetically

2)Select 'column1' or 'column2 'based on which value populated comes second alphabetically

3)Set column Basis to the concatenated value of 'column1' and column2 where the currency code that is alphabetically first is the first in the concatenated value [e.g. GBP/USD]

Could you please some one help me on this?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

A bit confusing and I'd rather not make any assumptions... here is where an example would come in handy. Can you post samples of your input and then based on those input records show us what the desired output would be? And your source is what - flat file, database table?

I'd also be curious what, if anything, you've tried so far.
-craig

"You can never have too many knives" -- Logan Nine Fingers
RK72
Participant
Posts: 154
Joined: Wed Sep 29, 2010 4:10 pm

Post by RK72 »

Hi Chullet,

Here is i have my input column1 have 'USD' and second column2 have 'GBD' so based on first point i need to get column2 value 'GBD'
becuse it is in firsr alphabatical order, how can we do in datastage job?

and my input data is dabase table.
rkashyap
Premium Member
Premium Member
Posts: 532
Joined: Fri Dec 02, 2011 12:02 pm
Location: Richmond VA

Post by rkashyap »

RK72,
Desired logic is not very clear. As Craig has already asked ... post:
1. Samples of your input records.
2. Sample of desired output based on those input records.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Perhaps something like the following will do it.

Code: Select all

If Col1 > Col2 Then Col1 : "/" : Col2 Else Col2 : "/" : Col1
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply