Change capture not taking input from "before" link

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

ady
Premium Member
Premium Member
Posts: 189
Joined: Thu Oct 12, 2006 12:08 am

Change capture not taking input from "before" link

Post by ady »

The 2 sources I am using are sequential files with diferrent names, they have the same data and metadata.

I am just trying to test the stage as I'v never used it before.

There is 1 key for the file and I am doing an Internal ascending sort.

change mode = Explicit keys, All values

Drop Output for Copy = False

Drop Output For Delete= False

and everything in the options is marked False....

when I am running the job I see that rows are comin in from just the "after" link, No rows are coming form the "before" link.

What am I doin wrong here ?
Last edited by ady on Tue Dec 19, 2006 11:47 am, edited 1 time in total.
us1aslam1us
Charter Member
Charter Member
Posts: 822
Joined: Sat Sep 17, 2005 5:25 pm
Location: USA

Post by us1aslam1us »

Have you defined both the files in the Input tab of Change Capture stage?

sam
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

So why is this marked as a 'Server' question?
-craig

"You can never have too many knives" -- Logan Nine Fingers
ady
Premium Member
Premium Member
Posts: 189
Joined: Thu Oct 12, 2006 12:08 am

Post by ady »

Do you mean the METADATA ? .. I havnt given the name of the files anywhere in the CC stage. Am i required to ?

The link ordering tab shows which file is input and output.
ady
Premium Member
Premium Member
Posts: 189
Joined: Thu Oct 12, 2006 12:08 am

Post by ady »

chulett wrote:So why is this marked as a 'Server' question?
oops my bad ..
ady
Premium Member
Premium Member
Posts: 189
Joined: Thu Oct 12, 2006 12:08 am

Post by ady »

Error: Input 'cc_PromoMaster.l_Previous' Sort requires a key column
Error: Input 'cc_PromoMaster.l_Current' Partitioner requires a key column
Error: Input 'cc_PromoMaster.l_Current' Sort requires a key column


Whats does this mean ?... I have specified a key :oops: :?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Go to the Inputs tab, to the Partitioning tab thereon. Have you specified a sort key there? For BOTH inputs? (Make sure, too, that you have specified identical key-based partitioning for both inputs.)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ady
Premium Member
Premium Member
Posts: 189
Joined: Thu Oct 12, 2006 12:08 am

Post by ady »

Done, Works now ... 1 more question

As of now I am using "change code" to check if the data has been changed. I wanna know how to write the changed data to a file.

I have created test data to check if what I am doin is right, I made changes to 3 columns in one of the source data by hardcoding a value.
But when I make "Drop output for copy" = "true" and the rest of the options to "false" and run the job it gives out the it should only write out the 3 columns right??

But it writes all the data out !
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

The condition don't restrict any column, but only rows. You can tell us what are the input columns and what are the output.
You can check the 'Change code' for which the output is obtained.
You should get the output of after records for other than copy.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
ady
Premium Member
Premium Member
Posts: 189
Joined: Thu Oct 12, 2006 12:08 am

Post by ady »

I have about 60 columns , MGMT_NO is the key.

I have manually hardcoded the city name and zipext . So now when I select the option "Drop Output for Copy" to be "True" the job should write out the rows which have been hardcoded by me right ?
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

If you look in to the help for Change code, you can understand that each code have different meaning. Copy: both before and after key and values are same.
Delete: If Before key is not present in after key.
Insert : If its a new key came in After records.....
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
ady
Premium Member
Premium Member
Posts: 189
Joined: Thu Oct 12, 2006 12:08 am

Post by ady »

I think I'v confused you guys.


The job I have to do is compare 2 sequential files (1 from DEV and 1 from PROD) and see if they are the same. If they are not the same and the records have different data then I have to write the data which is different into another Seq file.

I am trying to use Change capture for this, I need to know if I am missing something here
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Ok going back to your question, if both the key fields are same and all the values specified are same, it comes through Copy change code, which includes city name and zipext.
If you are just testing it, allow all the type of change code and analyze what record came with which change code. It will give you an idea of what you expected and what went wrong (if any).
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
ady
Premium Member
Premium Member
Posts: 189
Joined: Thu Oct 12, 2006 12:08 am

Post by ady »

I tried it and when I select TRUE for the DROP OUTPUT FOR COPY option , It gives me the correct result with the CODES.

But I want the job to output the rows which are not present in the BEFORE data set and are present in the AFTER data set. ie: the updated rows.

Is there a option to do that ?
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

As I mentioned earliar, the records that are not present in Before is INSERT. (NEW records).
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
Post Reply