Datastage Scenarios 3
Datastage Scenarios 3
Datastage Scenarios 3
Calculate the TAX for each employee who belongs to the sales department if sal
is greater than 5000 then calculate the tax as sal*0.17 else calculate the TAX as
SAL*0.13
Source:
Target:
Logic: use filter stage to filter the rows where deptno=30 and create a new
column in Transformer ie.TAX and write the derivation which is given below
Job Design:
Scenario2:
Calculate the total salary for each employee based on SAL&COMM(Comm col
may have Nulls)
Source:
Target:
Logic: Create a new column in Transformer ie.Totalsal and write the derivation
which is given below
Job Design:
Scenario3:
Create a job using filter stage to load the data which is having job as analyst
Source:
Target:
Job Design:
Scenario4:
If(is null(comm,sal,sal+comm)
If totalsal greater than 8000 then calculate the tax as TOTSAL*0.25 ELSE
Calculate the TAX as TOTSAL*0.15
Source:
Target:
Logic:
Create three new columns with Names TAX,HRA,ANNSAL and write the derivation
for each column which is given below
TAX=If TOTSAL> 8000Then TOTSAL*0.25 Else TOTSAL*0.15
HRA=TOTSAL*0.18
ANNSAL=TOTSAL*12
Job Design:
Scenario5:
Source:
Target:
Job Design
Logic:
VCUMMSUM=VCUMMSUM + DSLink3.SAL
Scenario6:
Source:
Target:
SQL query:
Union
Second query:
union
union
union
select deptno,max(sal) min_max from emp where deptno=20 group by
deptno
union
union
Job Design:
Scenario7:
GROSS SAL=TOTSAL+HRA-TAX
TOTSAL=SAL+COMM
TAX=SAL*0.17
Source:
Target
Logic:
TAX=DSLink4.SAL*0.17
HRA=DSLink4.SAL*0.18
TAX=TAX
HRA=HRA
Scenario8:
Source:
Target:
Job Design:
Job Logic:
Scenario9:
Source:
Target:
Job Design:
Job Logic: Take one record from head and take one record from Tail and
club these two at target
Scenario 10
Source:
Target:
JOB:
select * from emp where rownum <= ( select count(*)/2 from emp)
Scenario 11:
Target:
Job Design:
Job Logic:
Select * from emp minus Select * from emp where rownum <= ( select
count(*)/2 from emp)
Scenario 12:
Target:
Even:
Odd:
Job Design
JobLogic:
Create Stage variable with name Flag and enter following derivation
And in Transformer Constraints Even link apply the condition FLAG="EVEN" Similarly
for Odd constraint apply the condition FLAG="ODD"
Scenario13:
Source:
Target1:
Target2:
Target3:
Job Design:
Job Logic:
Scenario6:
Scenario7:
Scenario8:
Design a job that can load employees whose employee name start with S or J
Scenario9:
Scenario10:
Scenario11:
Design a job that can load load 5th and 8th record into atarget
Scenario12:
Source:
Target:
Scenario13:
Source
Cust_FNa
Custid me Cust_LName City
7001 BILL CLINTON HYD
7002 NARA LOKESH BANG
7003 SONIA GANDHI DELHI
7004 VENKAT RAVI VIZAG
Target:
Scenario14:
Source:
Cust_FNa
Custid me Email
7001 VENKAT [email protected]
7002 SUJANA [email protected]
[email protected]
7003 KRSIHNA M
Target:
Cust_FNa
Custid me Email Username
7001 VENKAT [email protected] VENKAT
7002 SUJANA [email protected] SUJANA
[email protected]
7003 KRSIHNA M KRISHNA
Scenario15:
Source:
Custid Cust_Name
7001 VENKAT RAVI
7002 SRIDHAR REDDY
7003 SOBHA RANI
Target:
Scenario16:
Source:
Custid Cust_Name
VENKAT RAVI
7001 KUMAR
RAVI RAJA
7002 PINISETTI
Target:
Cust_MNa
Custid Cust_FName Cust_MName me
7001 VENKAT RAVI KUMAR
7002 RAVI RAJA PINISETTI
Scenario17:
Source:
EMPID PHONE
7369 9948047694
7370 9912395605
7371 8600097130
Target:
EMPID PHONE
7369 (994)-80-476-94
7370 (991)-23-956-05
7371 (860)-00-971-30
Scenario18:
There are three target tables with name T1,T2,T3 emp name start with S pass
to T1 AND emp name start with J pass to T2 AND others pass to T3
Scenario19:
There are twotarget tables with name T1,T2 and 2 nd record pass to T1 AND 8 th
record pass to T2
Scenario20:
There are two target tables with name T1,T2 And alternative records pass to
T1 AND Others pass to T2
Scenario21:
sourcedata
Colum
n
10
10
10
20
20
20
30
30
Targetdata:
Colum Colum
n1 n2
10 1
10 1
10 1
20 2
20 2
20 2
30 3
30 3
Scenario22:
sourcedata
Colum
n
10
10
10
20
20
20
30
30
Targetdata:
Colum Colum
n1 n2
10 1
10 2
10 3
20 1
20 2
20 3
30 1
30 2
Scenario23:
sourcedata
Colum
n
10
10
10
20
20
20
30
30
Target data:
Colum Colum
n1 n2
10 1
10 2
10 3
20 4
20 5
20 6
30 7
30 8
Scenario23:
Source data:
Colum
n
10
10
10
20
20
20
30
30
Target data(T1)
Colum
n1
10
20
30
Target data(T2)
Colum
n2
10
10
20
20
30
Scenario24:
There are two sources with Name S1&S2 and S1 Having 5 fields and S2 haing 3
fields there is no common column
Scenario25:
Sourcedata
Empid Sal
1 1000
2 2000
3 3000
4 5000
Target data:
Scenario26:
Scenario27:
Scenario28:
If source contains N-rows where N=EVEN Load First half records into the target
Scenario29:
If source contains N-rows where N=EVEN Load Second half records into the
target
Minus
Scenario30:
Sourcedata
Empid Sal
1 1000
2 2000
3 3000
4 5000
Target data: