Datastage Scenario Based Questions - Part 3

Datastage Scenario Based Questions - Part 3


1. Consider the following product types data as the source.

Product_id, product_type
------------------------
10,          video
10,          Audio
20,          Audio
30,          Audio
40,          Audio
50,          Audio
10,          Movie
20,          Movie
30,          Movie
40,          Movie
50,          Movie
60,          Movie

Assume that there are only 3 product types are available in the source. The source contains 12 records and you dont know how many products are available in each product type.

Q1. Create a job to select 9 products in such a way that 3 products should be selected from video, 3 products should be selected from Audio and the remaining 3 products should be selected from Movie.

Q2. In the above problem Q1, if the number of products in a particular product type are less than 3, then you wont get the total 9 records in the target table. For example, see the videos type in the source data. Now design a mapping in such way that even if the number of products in a particular product type are less than 3, then you have to get those less number of records from another product types. For example: If the number of products in videos are 1, then the reamaining 2 records should come from audios or movies. So, the total number of records in the target table should always be 9.

2. Create a job to convert column data into row data.
The source data looks like

col1, col2, col3
----------------
a,    b,    c
d,    e,    f

The target table data should look like

Col
---
a
b
c
d
e
f

3. Create a job to convert row data into column data.

The source data looks like

id, value
---------
10,  a
10,  b
10,  c
20,  d
20,  e
20,  f

The target table data should look like

id, col1, col2, col3
--------------------
10,  a,   b,     c
20,  d,   e,     f

Recommended Reading

More Scenarios Based Interview Questions on Datastage at
Datastage Scenario Based Questions - Part 1
Datastage Scenario Based Questions - Part 2

Post a Comment