Ramana@scenarios
Ramana@scenarios
Ramana@scenarios
1. I have “10” records in input files & “4” fields such as enum,enam,deptnum,sal. I want to get only
deptnum “10” records in output. How will you achieve this?
2. I have 100records in input file.I want to display 50-75 records. How can you do it?
O/P:
Username domainname domainextension
Ramana.abinitio gmail com
Kiran.abinitio rocketmail com
Lokesh.abinitio yahoo com
Venkat gmail com
38. I/P:
Snum m1 m2 m3 m4
10 10 20 30 40
20 80 70 60 50
30 40 30 50 80
O/P:
snum marks
10 10
10 20
10 30
10 40
20 80
20 70
20 60
20 50
30 40
30 30
30 50
30 80
40 90
40 100
40 110
40 120
39. How to separate header ,body & trailer records with and without using indicator?
40.Balls & runs
I/P: O/P:
1 0 1 6 0 16
2 4 2 5 1 17
3 6
4 3
5 2
6 1
7 5
8 2
9 4
10 2
11 3
12 1
41. I have ‘500’ records & I have ‘5’ partitions. I need to get each ‘100’ record into each partition. How will
you do this?
42.I have two input files, one input have ‘100mb’ of data & other input have ‘100kb’ of data. I need output
both 100mb & 100kb of data. How will you do this?
id marks id marks
1 10,20 1 10
2 30,40 1 20
3 50,60 2 30
2 40
3 50
3 60
44. I/P: O/P:
Ramana anamar
45. How will you count the records using rollup & without using rollup?
46. I/P0: I/P1:
100records 30 records
O/P:
130records
Banglore
Hyderabad
Chennai
Banglore
a 1 a1
b 2 b2
c 3 c3
d 4 d4
49. I/P:
names
bihar
patna
chandigarh
assam
andhra pradesh
uttar pradesh
gandhi nagar
east coast india
west coast india
O/P:
col1 col2 col3 col4
bihar andhra Pradesh east coast india 4
patna uttar Pradesh west coast india 3
chandigarh gandhi nagar 2
assam
50. I/P:
Num
1231231234
O/P:
Num count
1 3
2 3
3 3
4 1
52. I/P:
Jan feb march april may
900 100 700 350 150
100 600 200 450 300
500 200 100 200 450
O/P:
Month total
Jan 1500
Feb 900
March 1000
April 950
May 900
60. I/P:
Id sal month bonus
1 1000 jan 10
1 2000 feb 20
1 3000 march 0
2 1000 april 10
2 4000 may 30
2 6000 june 0
O/P:
Id sum jan feb march april may june
1 6030 1000 2000 3000 0 0 0
2 11040 0 0 0 1000 4000 6000
O/P:
name friendname
A ganesh,madhan
B kiran
C lokesh
62. I/P1:
Num alpha
1 A
2 B
3 C
4 D
5 E
O/P:
Col
64. I/P:
Source destination distance
Hyderabad Kurnool 250
Nellore Banglore 400
Vijayawada Hyderabad 270
Kurnool Hyderabad 250
Banglore Nellore 400
Hyderabad Vijayawada 270
O/P:
Source destination distance
Banglore Nellore 400
Hyderabad Kurnool 250
Hyderabad Vijayawada 270
65. I/P:
Custid custname product amount
111 kiran iphonex 600USD
O/P:
76. Records from 5-10 by using next_in_sequence() and with out using next_in_sequence().
77. first 5 records different ways.
78. replace first character of ename with T[firstcharacter].
79. I/P: O/P:
empnum ename snum empnum ename
100 a 1 100 a
200 b 2 200 b
80. replace 4th column with present date where my file is | delimiter.
81. What is multifiles?
a. I have 1,2,3,4,5 records in one input file . It is 2-way Multifile. I want output 1,3,5 in one file 2,4
records in second output file?
b. I have 1,2,3,4,5 records in one input file . It is 2-way Multifile. I want output 1,2,5 in one file 3,4
records in second output file?
82. There are 12 records are in input file and in the output we want 4 serial files with equal amount of data.
input file--> ??--> 4 serail files
which compoent will you use ??
83. I have 50 records in my input table without using any component do the parallel unload i.e;
1-10----->1st partition
11-20---->2nd partition
INPUT: OUTPUT:
Empno Deptno Sal Cal_sal
85. Empno Deptno Sal
1 10 2000 2000
1 10 2000
4 10 6000 8000
2 20 3000
6 10 7000 15000
6 10 7000
2 20 3000 3000
3 30 3000
5 20 4000 7000
5 20 4000
3 30 3000 3000
4 10 6000
86.
Input File Output File
A 1 A-B-C 6
B 2
C 3
87. Use FUSE component and tell me the output for below two tables
Table1 Table2
AcctNo AcctName City
CustID state Country
9999 John Hyd
1001 CA US
8888 Aavi Chennai
1002 TX US
7777 Nani Dubai
1003 NY US
6666 Navin Banglore
1004 NJ US
5555 Suman Hyd
1 Anu 10
1 Anu 10
1 Anu 10
2 Bapu 20
2 Bapu 20
2 Bapu 20
1001 10 1001 60
1001 20 1002 95
1001 30
1002 5
1002 40
1002 50
91. input column having the string value ashok____kum___ar like that , I ant the output as ashok_kumar
how can you do this?
92. I/P:
subject marks
english 65
hindi 70
science 75
english 55
hindi 50
science 70
how to generate the same sequence number per each group. Treat firstEnglish , hindi & science are one
group?
93. I/P:
My question is how to generate the rank group wise by using scan with out using scan?
97. what is dedupsort?In dedup sort key is null what happen? keep first,last,unique
input
1
1
1
2
2
3
98. 8 way multifile in each partition we have 10 records is there in rollup key is null how many records go
to output and count of records?
99. I/P: O/P:
a 10 a 40
a 20 a 40
a 10 a 40
b 10 b 10
c 10 c 10
d 30 d 30
kiran kiran 1
lokesh lokesh 1
sai sai 2
rahul rahul 2
subbakka subbakka 2
101. I/P: O/P:
12abc45 12###45
78efg31 78###31
102. If I have 100 fields in a file and each field have the one duplicate record , How you remove the that
duplicated records
103. I/P: O/P:
f1 f2 f1 f2
a 1 abc 1
b 2 abc 2
c 3 abc 3
104. 3 way join component
I have 3 files each having 2 cols
e.g
File1
empid deptid
1 100
2 200
3 200
4 100
5 300
File2
empid salary
1 10
2 20
3 30
4 40
5 50
6 60
File3
deptid deptname
100 A
200 B
300 C
400 D
in the output i want total amt spent on each dept i.e A,B,C,D which would be a sum in rollup for each
dept(100,200,300,400) salary of each employee.
So here i will have to join
File1.empid =File2.empid (which gives salaries) AND
File1.deptid = File3.deptid (which gives dept name)
So... in o/p i want dept_name and amt_spent_each_dept
My solution has
File1 ---
File2 ------[ JOIN] ---[Rollup] --- [File4 as output]
File3 ---
But what condition can i have in JOIN component to join these 3 tables ?
107. In input dataset i am having 100 records. I want records between 50-75 and i don't want to read
5th record? which component i have to use.
108. How to separate duplicate records with out Dedup sorted from the grouped input file?
110.I/P: O/P:
Date amount Date amount
01-01-2016 100 01-01-2016 300
01-01-2016 300 01-01-2016 250
02-01-2016 350 02-01-2016 400
01-01-2016 200 02-01-2016 350
02-01-2016 150
02-01-2016 400
01-01-2016 250
02-01-2016 250
I want to find out top ‘2’ transactions on each date?
111.I/P: O/P:
Id Col1 Col2 Id Col1 Col2
a 100 Null a 100 200
a Null 200 b 300 400
b 300 Null
b Null 400
112. I have input like 1,2,3-7,8,9 How to generate output like below
O/P: 1
2
3
4
5
6
7
8
9
113. I have header and trailer records to some body records like below
emp.dat|12042016
1/A/1000
2/B/2000
3/C/3000
3
Here there is no record indicator.
How will you eliminate and separate header and trailer records without using Next In Sequence, Dedup
sorted and any Partition components?
132. Pulling out the records which are same in two records:
I have two files and I want to compare those two records ,after comparing I want to pull out the records
which are same in both records and I want the new record from the unmatched records
record format is like this:
decimal(3) CUST_ID;
string(6) CUST_NAME;
string("") ADDRESS;
Record format is same for two files:
and my records are
01 sidhu hyd
02 phani bng
03 hasnu che
04 azeem vtm
second file records are
01 sidhu che
02 phani bng
03 hasnu bng
04 azeem hyd
so I want now how to compare these two records and how can I get the file two record in my output by
comparing these two files
133. If we give NULL key in scan component what will be the output and in dedup with keep parameter as
unique?
135. If I have 2 files containing field file1(A,B,C) and file2(A,B,D), if we partition both the files on key A using
partition by key and pass the output to join component, if the join key is (A,B) will it join or not and WHY?
136. Header details and trailer validation for multi file:
My requirement
header contains - business date
details contains - reccords
trailler contains - total no of records in detail.
1) header , detail , trailer separation with indicator filed ( conditional dml with indicator field )
2)Comparing header with business date , if not match fail. ( using lookup with date function)
3)comparing the record count of the details record with trailer if not match fail the graph.( please tell me this
point)
input file -> reformat ( count 3) -> .
137. I have 400 records in my in0 file, its 4-way multifile system. How can I find out particular 150th record will
goes to which partition using Partition by Key?
138. On which parameter based broadcasting partition distribute the records to the outputs?
140. How to calculate the total number of records in the file using REFORMAT instead of ROLLUP?
142.I/P: O/P:
City bank city bank
Chennai SBI Banglore Andhrabank,SBI
Banglore Andhrabank Chennai SBI,HDFC
Hyderabad HDFC Hyderabad HDFC,SBI
Banglore SBI
Chennai HDFC
Hyderabad SBI
143.