Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

diff between OLTP and OLAP? what TOP-DOWN and BOTTOM-UP Approach? which is best? what are Star Schema and Snow Flake Schema?

2 Answers   TCS,


Triggers,VIEW,Procedures

0 Answers   CTS,


what is the difference between INROWNUM AND OUTROWNUM IN DATASTAGE SERVER EDITION?

2 Answers  


what is the function in Transformer stage can act as Rank function in Oracle

1 Answers   Reliance,


Hi everyone,I have kept a project Sales And Distribution for a pharmaceutical company.can anybody explain one complex business rule that we had in our project and how did you accomplish it using DS?

0 Answers   HCL,


What is the difference between validated and compiled in the datastage?

0 Answers  


What are the types of containers and how to create them?

0 Answers  


What is Fastly Changing Dimension?

6 Answers   TCS,


How do you register plug-ins?

0 Answers  


How do you reject records in a transformer?

0 Answers  


How to work with XML out put stage? Please explain step by step? i need to generate XML file using Table data. Given is the .XSD file. Please help?

2 Answers   TCS,


source contains 2 columns comes to target 4 columns how

1 Answers   IBM,


Categories