Page 1 of 1
how does a shared container work???
Posted: Fri Mar 18, 2005 2:28 am
by Pavan_Yelugula
Hi all
can you please tell me how a shared container work
i have job design which looks like this
Seq1-->SharedContainer--->seq2
If i have 10 records in my seq1 file. will my shared container execute 10 times taking one record at a time.
or
will all the 10 records be grouped and the shared conatiner will execute once and then the output will be written to seq2.
i guess i am a bit ambigous but i guess u will understand what my question is
Thanks and regards
pavan
Re: how does a shared container work???
Posted: Fri Mar 18, 2005 2:37 am
by bchau
Pavan_Yelugula wrote:can you please tell me how a shared container work
i have job design which looks like this
Seq1-->SharedContainer--->seq2
If i have 10 records in my seq1 file. will my shared container execute 10 times taking one record at a time.
or
will all the 10 records be grouped and the shared conatiner will execute once and then the output will be written to seq2.
well the container will run per row just as if it was a stage in a job. I'm not sure what you mean by execute, but 10 records means that the stage will handle the 10 records that come in, one row at a time. THe shared container works much the same way.
Posted: Fri Mar 18, 2005 2:53 am
by Pavan_Yelugula
ok
i will try to give you a brief overview of the problem
my job designs looks like this
seq1-->sharedcontainer--->seq2
shared container design
table
^
|
Aggregator
^
|
|
Inputlink--->transformer---->outputlink
i have a column in seq1 which is called maxreckey. it is a numeric number.
i want to calculate the maximum of the maxreckey of the all the records that come in and put it in my table.
So for example
suppose my seq1 has records like this
serialnumber|maxreckey
--------------- -------------
1|20
2|10
So coming back to my basic question whether a shared container gets executed once or as many times as the number of records
if the shared conatiner gets executed once then my logic will be right. the aggregator going to group all the records find the maximum and put it in my table
but if the shared conatiner executes twice like in my case then first it will put 20 and when the next time it executes it will update with 10
throwing my logic in a jiffy
I wanted to know if what i am doing will get what the result i am expecting
The DS documentation says shared container is just for a visual simplicity and the Data stage is going to break it up and put the links which are their in the shared container when the jobs gets executed. if that is the case i don guess what i have done is wrong it will work
I guess i got the point across pretty clearly this time
Any inputs will be highly helpful for me
Thanks and Regards
Pavan
Posted: Fri Mar 18, 2005 3:41 am
by bchau
well, i just tried it....and it seems to be outputting according to your logic. So i guess the ascential documentation was correct. datastage does break down the shared container as if it was just part of the job. my result from the aggregator was 30 (sum of 20 and 10).
Are you summing the maxreckey in your aggregator?
Posted: Fri Mar 18, 2005 4:22 am
by Pavan_Yelugula
Thanks a lot for trying it out with a example
Actually i am trying to get the maximum of the reckey and please note that the data is not sorted
Thanks for the help
Pavan
Posted: Fri Mar 18, 2005 4:52 am
by bchau
Pavan_Yelugula wrote:Thanks a lot for trying it out with a example
Actually i am trying to get the maximum of the reckey and please note that the data is not sorted
Thanks for the help
Pavan
Anytime....good luck!
Posted: Fri Mar 18, 2005 3:09 pm
by Aravind
Pavan, the same can be achieved by using a sort stage and a stage variable in the transformer