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



Hi, Please tell me how to solve this scenario in datastage ? Here we have 3 columns in a table..

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

Post New Answer

More Data Stage Interview Questions

Hi , Today 1000 records updated, tomorrow 500 records updated how to find that?

4 Answers   Wipro,


Hi friends,Two input files, wants to validate only if the reference data has '0' otherwise no validation should be done..how to do this??

1 Answers   IBM,


What are the types of hashed files in data stage

0 Answers  


How u implement the slowly changing dimensions if my source table is consisting of cid,cname,add,phno,email but i need to capture the changes for first three columns how u implement?

1 Answers   IBM,


whats relation between configuration file and datasets?

2 Answers   L&T, Wipro,






Describe the architecture of datastage?

0 Answers  


job locking methods? How can we unlock the job?

3 Answers   IBM,


how to design the change capture stage in(data stage parallel jobs) type 2

2 Answers   IBM,


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?

4 Answers   SLK Software,


Can we use sequential file as source to hash file? Have you do it ?if what error it will give?

1 Answers   SS Solutions,


how to get sum of sal based on dept_no and then sum of all sal irrespective of dept_no in same sql. output:- 10, 200(sum of sal for dept_no 10), 5000(sum of all sal)

0 Answers  


i have a some records eno ename acono amount 1001 suresh sbi101 12000 1001 suresh sbi101 14000 1001 is dublicata how can i remove duplicate?

4 Answers  


Categories