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
Cherukuri
Participant
Posts: 46 Joined: Wed Jul 25, 2007 2:43 am
Location: India
Contact:
Post
by Cherukuri » Thu Feb 09, 2012 8:55 am
Hi
I have a requirement like the datastage job should automate to run for every 5 mins.
first time the job is run and file loaded in /tmp/target/ and second time when it run the new file should check the key value on the existed data (that was run before) and if no key value exists then the record should CREATE (insert in the target file) and if the key exist in the target file then the values should UPDATE.
Please could any one help me to approach this requirement.
Regards,
Cheru.
Cheru
pandeesh
Premium Member
Posts: 1399 Joined: Sun Oct 24, 2010 5:15 am
Location: CHENNAI, TAMIL NADU
Post
by pandeesh » Thu Feb 09, 2012 9:06 am
It looks like, do you want to achieve insert/update mechanism in sequential file?
pandeeswaran
chulett
Charter Member
Posts: 43085 Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO
Post
by chulett » Thu Feb 09, 2012 9:08 am
Start by posting in the correct forum.
-craig
"You can never have too many knives" -- Logan Nine Fingers
Cherukuri
Participant
Posts: 46 Joined: Wed Jul 25, 2007 2:43 am
Location: India
Contact:
Post
by Cherukuri » Fri Feb 10, 2012 6:23 am
pandeesh wrote: It looks like, do you want to achieve insert/update mechanism in sequential file?
YES its an INSERT/UPDATE mechanism in file.. please explain me.. thank you.
Cheru
chulett
Charter Member
Posts: 43085 Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO
Post
by chulett » Fri Feb 10, 2012 8:22 am
There is no mechanism to "update" a sequential file. You'll need to compare both sources and either write out new/updated records from the new source or any original records not 'updated'.
-craig
"You can never have too many knives" -- Logan Nine Fingers
pandeesh
Premium Member
Posts: 1399 Joined: Sun Oct 24, 2010 5:15 am
Location: CHENNAI, TAMIL NADU
Post
by pandeesh » Fri Feb 10, 2012 8:24 am
I believe you can use change capture stage for this.
pandeeswaran
Cherukuri
Participant
Posts: 46 Joined: Wed Jul 25, 2007 2:43 am
Location: India
Contact:
Post
by Cherukuri » Fri Feb 10, 2012 9:36 am
pandeesh wrote: I believe you can use change capture stage for this.
---
I tried using change capture stage and it worked as expected
Thank you for the help..
Cheru
qt_ky
Premium Member
Posts: 2895 Joined: Wed Aug 03, 2011 6:16 am
Location: USA
Post
by qt_ky » Fri Feb 10, 2012 10:01 am
chulett wrote: There is no mechanism to "update" a sequential file.
Are you sure?
Choose a job you love, and you will never have to work a day in your life. - Confucius
chulett
Charter Member
Posts: 43085 Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO
Post
by chulett » Fri Feb 10, 2012 10:04 am
Quite. That's the nature of sequential media. Now, we're not talking via an editor, stream or not, I'm saying you can't treat it like a relational source and update a specific record in place... unless we've moved into the realm of indexed sequential files.
-craig
"You can never have too many knives" -- Logan Nine Fingers
qt_ky
Premium Member
Posts: 2895 Joined: Wed Aug 03, 2011 6:16 am
Location: USA
Post
by qt_ky » Fri Feb 10, 2012 11:50 am
chulett wrote: you can't treat it like a relational source
Quite certain are you? What know you of certainty?
Choose a job you love, and you will never have to work a day in your life. - Confucius
chulett
Charter Member
Posts: 43085 Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO
Post
by chulett » Fri Feb 10, 2012 1:27 pm
Away put your weapon.
-craig
"You can never have too many knives" -- Logan Nine Fingers
qt_ky
Premium Member
Posts: 2895 Joined: Wed Aug 03, 2011 6:16 am
Location: USA
Post
by qt_ky » Fri Feb 10, 2012 3:34 pm
Setup the ODBC Text driver you can.
Choose a job you love, and you will never have to work a day in your life. - Confucius
chulett
Charter Member
Posts: 43085 Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO
Post
by chulett » Fri Feb 10, 2012 6:56 pm
That path leads to the Dark Side.
-craig
"You can never have too many knives" -- Logan Nine Fingers
qt_ky
Premium Member
Posts: 2895 Joined: Wed Aug 03, 2011 6:16 am
Location: USA
Post
by qt_ky » Sat Feb 11, 2012 6:42 am
Craig... I am your father.
Choose a job you love, and you will never have to work a day in your life. - Confucius
Cherukuri
Participant
Posts: 46 Joined: Wed Jul 25, 2007 2:43 am
Location: India
Contact:
Post
by Cherukuri » Mon Feb 13, 2012 2:29 am
Hi Eric,
I did not review the work done by my team on using the Change capture stage..
but told its worked .. let me check the same and will revert if its worked or not.
Regards,
Cheru.
Cheru