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
DSFreddie
Participant
Posts: 130 Joined: Wed Nov 25, 2009 2:16 pm
Post
by DSFreddie » Fri Jul 30, 2010 7:57 am
Hi All,
I have a scenario where I need to extract the data from a Mainframe DB2 table(Table A) based on the condition given below.
I have another table from where I need to take max(date)----Select max(date) from table B.
Now, i need to pull the data from Table A based on the condition
A.(Date) > max(B.date)
Pls note that one table is in Mainframe DB2 & the other one is in DB2.
Thanks for your help.
Freddie.
anbu
Premium Member
Posts: 596 Joined: Sat Feb 18, 2006 2:25 am
Location: india
Post
by anbu » Fri Jul 30, 2010 8:24 am
Create a job to get maximum date from Table B and unload it to a file.
Read maximum date from this file and pass it as a parameter to your second job extracting data from Table A
You are the creator of your destiny - Swami Vivekananda
DSFreddie
Participant
Posts: 130 Joined: Wed Nov 25, 2009 2:16 pm
Post
by DSFreddie » Fri Jul 30, 2010 9:14 am
Thanks for your reply Anbu.
Is there any way to accomplish this in a single job?
Pls let me know whether are any alternate ways of doing this as I do not want to create 2 jobs for this.
Thanks,
Freddie
ArndW
Participant
Posts: 16318 Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:
Post
by ArndW » Fri Jul 30, 2010 9:20 am
You cannot do this directly in one job using DB2 stages. It is better to have a sequence which calls first one job to get the max value, then passes that value to the second job which then performs the SQL.