Problem in Surrogate key stage

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

Post Reply
r
Participant
Posts: 13
Joined: Tue May 17, 2005 6:16 am

Problem in Surrogate key stage

Post by r »

hi ,

i was having problem with surrogate key stage.

I am having a failed validation while using a surrogate key generator stage.The error that is specified is

Surrogate_Key_Generator_1: One of these must be provided:

Surrogate_Key_Generator_1: -schema

Surrogate_Key_Generator_1: ,

Surrogate_Key_Generator_1: -schemafile

the code is as follows:

Code: Select all

Surrogate key name =s1
Output type = 32 bit integer
start value=1

Input:
partitioning=Auto
Coulumns
k1 integer len=10 Nullable =yes
k2 integer len=10 Nullable =yes
k3 integer len=10 Nullable =yes

Output:
Coulumns
s1 integer len=10 Nullable =no key
k1 integer len=10 Nullable =yes
k2 integer len=10 Nullable =yes
k3 integer len=10 Nullable =yes
Please help me out

Thanks & Regards
r
tardifma
Premium Member
Premium Member
Posts: 23
Joined: Tue Jan 24, 2006 10:53 am

Post by tardifma »

Hi r.

Can we have a little bit more detail about your job...

From what I know, I schema file is used by a Column Generator or a Row generator...

I've never seen the option "Schema file" or "Schema" in a surrogate key generator...

What looks like your mapping? Is Surrogate_Key_Generator_1 is really the name of the stage???

Give us more detail please.
Thanks
The Brute
aramachandra
Participant
Posts: 55
Joined: Tue Sep 20, 2005 10:58 am

Post by aramachandra »

I was going to say the same as the previous poster..

It looks like you might want to review your metadata to ensure there is not mismatch there...

I have not seen this in the surrogate key generator error..

arvind
kwwilliams
Participant
Posts: 437
Joined: Fri Oct 21, 2005 10:00 pm

Post by kwwilliams »

r,

I created a job with the exact same inputs and puts that you had and get it to compile without any error.

Here is my OSH:

Code: Select all


################################################################################################################
#### STAGE: Sequential_File_1
## Operator
export
## Operator options
-schema record
  {final_delim=end, delim=',', quote=double}
(
  k1:nullable int32;
  k2:nullable int32;
  k3:nullable int32;
  s1:int32;
)
-file '[&_TARGETDIR]/testkww.txt'
-overwrite
-rejects continue

## General options
[ident('Sequential_File_1'); jobmon_ident('Sequential_File_1')]
## Inputs
0< 'Surrogate_Key_Generator_2:DSLink5.v'
;

#################################################################
#### STAGE: Surrogate_Key_Generator_2
## Operator
generator
## Operator options
-schema record
(
  s1:int32 {cycle={init='1+part',incr=partcount}};
)

## General options
[ident('Surrogate_Key_Generator_2'); jobmon_ident('Surrogate_Key_Generator_2'); par]
## Inputs
0< 'Row_Generator_3:DSLink4.v'
## Outputs
0> [] 'Surrogate_Key_Generator_2:DSLink5.v'
;

#################################################################
#### STAGE: Row_Generator_3
## Operator
generator
## Operator options
-schema record
(
  k1:nullable int32 {cycle={init=1}};
  k2:nullable int32 {cycle={init=2}};
  k3:nullable int32 {cycle={init=3}};
)
-records 10

## General options
[ident('Row_Generator_3'); jobmon_ident('Row_Generator_3')]
## Outputs
0> [] 'Row_Generator_3:DSLink4.v'
;

If I were you, I would open a case with IBM. Have you been able to use the Surrogate Key Generator in the past?
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

What is the structure of you job.
Just try with a row generator and seq generator and a sequential file, to ensure, not issue with surrogate key.

-Kumar
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You need to pass at least one other column through the stage. Having a column generates a schema for the stage. Or you can specify a schema file or runtime column propagation in the stage properties.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply