Hi,
Please tell me how to solve this scenario in datastage ?
Here we have 3 columns in a table TEST
CODE,ENTRY DATE and BATCH
The table looks like
CODE ENTRYDATE BATCH
100 100716 1
100 100716 1
100 100716 1
200 122517 2
200 122517 2
302 555555 8
302 555555 8
302 555555 8
We need to create a seqno on grouping these 3 columns.
The result should be like this.
CODE ENTRYDATE BATCH SEQNO
100 100716 1 1
100 100716 1 2
100 100716 1 3
200 122517 2 1
200 122517 2 2
302 555555 8 1
302 555555 8 2
302 555555 8 3
Answer / raj
The only solution I can get readily is using stage variables in a transformer. In order to achieve this I need to define 3 stage variables to map them to input columns. Another 3 stage variables to store the previous value. Another 3 variables to compare the values. A total of 9 stage variables are needed.
To reduce the number of stage variables, lets us checksum stage
A checksum stage generates a unique value with the given columns as input.
We supply these three columns as input and generate unique values for each combination and then use that value for comparison in the transformer
Transformer:
Stage Variable:
Checksum -> Sv1
Sv2 -> Sv1
if Sv1=Sv2 then Sv3+1 else 1 -> Sv3
Sv3 -> SEQNO
We get the desired output
| Is This Answer Correct ? | 0 Yes | 0 No |
I have a few records just I want to store data in to targets cycling way how?
i have input like this Column 1 ,column 2 3,a 4,b 5.c i want output aaa bbbb ccccc Ple help any one?
Hi Gus, Can u pls tell me How can u Call the Shell Scripting/Unix Commands in Job Sequence?
which unix commands mostly used in datastage
hi this is kiran i have one table i want divide the table with two different table like even rows and odd rows how can i do this one tell me plzz
what are the errors,warnings in datastage
How do u call shellscript/Batch file from DS?
what is snow flack schema?
How to reverse the string using SQL?
Can we use sequential file as source to hash file? Have you do it ?if what error it will give?
tell me 5 situations when we r using oracle db stages like orecle connector, oracle enterprise
In my previous project we get data from mainframe and load it into datastage DB2 tables.Sometimes we get data as flat file or a mainframe tables itself directly we fetch the data.Is this a migration project?