DS job CREATE/UPDATE

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:

DS job CREATE/UPDATE

Post by Cherukuri »

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
Premium Member
Posts: 1399
Joined: Sun Oct 24, 2010 5:15 am
Location: CHENNAI, TAMIL NADU

Post by pandeesh »

It looks like, do you want to achieve insert/update mechanism in sequential file?
pandeeswaran
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

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 »

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
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

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
Premium Member
Posts: 1399
Joined: Sun Oct 24, 2010 5:15 am
Location: CHENNAI, TAMIL NADU

Post by pandeesh »

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 »

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
Premium Member
Posts: 2895
Joined: Wed Aug 03, 2011 6:16 am
Location: USA

Post by qt_ky »

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
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

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
Premium Member
Posts: 2895
Joined: Wed Aug 03, 2011 6:16 am
Location: USA

Post by qt_ky »

chulett wrote:you can't treat it like a relational source
Quite certain are you? What know you of certainty? :o
Choose a job you love, and you will never have to work a day in your life. - Confucius
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Away put your weapon. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
qt_ky
Premium Member
Premium Member
Posts: 2895
Joined: Wed Aug 03, 2011 6:16 am
Location: USA

Post by qt_ky »

:lol: 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
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

That path leads to the Dark Side. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
qt_ky
Premium Member
Premium Member
Posts: 2895
Joined: Wed Aug 03, 2011 6:16 am
Location: USA

Post by qt_ky »

Craig... I am your father. :shock:
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 »

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
Post Reply