Need help immediately

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
dvpawankumar
Participant
Posts: 46
Joined: Fri Oct 06, 2006 6:36 am
Location: Tucson

Need help immediately

Post by dvpawankumar »

Hi,
This is pavan here having a query regarding cartesian product.I wanna to know how to perform cartesian product in parallel jobs. Here iam posting the source and also the required output.
SOURCE1:
  • ENUM ENAME SAL
    100 aaa 1000
    101 bbb 1500
    102 ccc 900
SOURCE2:
  • DNUM DNAME
    10 eee
    20 iii
    30 JJJ
REQUIRED OUTPUT IS
  • ENUM ENAME SAL DNUM DNAME
    100 aaa 1000 10 eee
    100 aaa 1000 20 iii
    100 aaa 1000 30 JJJ
    101 bbb 1500 10 eee
    101 bbb 1500 20 iii
    101 bbb 1500 30 JJJ
    102 ccc 900 10 eee
    102 ccc 900 20 iii
    102 ccc 900 30 JJJ
I HOPE SOMEONE WILL HELP ME.


Thanks in advance,
Pavan.







    Precious
    Charter Member
    Charter Member
    Posts: 53
    Joined: Mon Aug 23, 2004 9:51 am
    Location: South Africa
    Contact:

    Post by Precious »

    I couldn't help but reply to this post, not because I can help, but because subject lines like that are almost guaranteed to put people off and get other people's backs up.

    Please read the following sticky note regarding appropriate subject headers.
    viewtopic.php?t=96330

    Regards,
    Precious

    Mosher's Law of Software Engineering: Don't worry if it doesn't work right. If everything did, you'd be out of a job.
    ray.wurlod
    Participant
    Posts: 54607
    Joined: Wed Oct 23, 2002 10:52 pm
    Location: Sydney, Australia
    Contact:

    Post by ray.wurlod »

    If you need help immediately buy premium service from your support provider. Learn the true cost of "urgent".

    DSXchange is an all-volunteer site. None of the posters is paid. They post as and when they can, unless they take offence at unreasonable demands and decide to impose a time penalty.


    Meanwhile you might like to search the forum.

    There is an answer; maybe it will be posted sometime in the next 48 hours. (It's already the weekend in some parts of the world.)
    IBM Software Services Group
    Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
    arnabdey
    Participant
    Posts: 50
    Joined: Wed Jan 10, 2007 5:56 am

    Hi

    Post by arnabdey »

    Hi

    If you are reading the data from two tables, you can directly do the join at the source table itself by writing appropriate query

    select ..,..,.. from tab1,tab2;
    Arnab
    ray.wurlod
    Participant
    Posts: 54607
    Joined: Wed Oct 23, 2002 10:52 pm
    Location: Sydney, Australia
    Contact:

    Post by ray.wurlod »

    Use a Column Generator stage to create a key column on each Data Set. The key column has a constant value, say 1, for all rows. Partition the smaller table as Entire. Effect an inner join based on this key.
    IBM Software Services Group
    Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
    dvpawankumar
    Participant
    Posts: 46
    Joined: Fri Oct 06, 2006 6:36 am
    Location: Tucson

    How to get Cartesian product

    Post by dvpawankumar »

    Hi,
    Iam thankful to ur replies.I need the cartesian product as output.I dont have any key column (i.e. common column ) in both tables.Then how can i achieve that in parallel job.I used the column generator and generated the common column.But i was not able to perform the cartesian product.

    Thanks in advance
    Pavan.
    kumar_s
    Charter Member
    Charter Member
    Posts: 5245
    Joined: Thu Jun 16, 2005 11:00 pm

    Post by kumar_s »

    Use column generator on both the inputs and join on the temp column whose values is 1.
    Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
    ray.wurlod
    Participant
    Posts: 54607
    Joined: Wed Oct 23, 2002 10:52 pm
    Location: Sydney, Australia
    Contact:

    Post by ray.wurlod »

    An inner join on an Entire-partitioned constant (the solution I posted earlier) will generate the required Cartesian product.
    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