You are on page 1of 15

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?

3. What will happen if I keep below values in select_expr of FBE?


I. 0
II. 100
III. -100
IV. ‘a’
V. -1000
VI. a
VII. ramana==ramana
VIII. “ramana”==ramana
IX. “ramana”==”ramana”
X. ename==”ramana”
XI. NULL
XII. NULL==NULL
XIII. “NULL”==”NULL”

4. How to filter NULL values?


5. Pause the records if deptnum is 10 or 20?
6. Pause the records if ename length is ‘5’ characters?
7. Pause the records if ename length is ‘5’ characters and deptnum is ‘10’?
8. Generate the sequence number for all records?
9. Find the length of the character (or) string for ename filed?
10.Filter the first two characters in ename field?
11.I have ‘100’ records in input file. I want to get “even” records in output?
12.I have ‘100’ records in input file. I want to get “odd” records in output?
13. I/P:
Mail id
Ramana.abinitio@gmail.com
Kiran.abinitio@rocketmail.com
Lokesh.abinitio@yahoo.com
venkat@gmail.com

O/P:
Username domainname domainextension
Ramana.abinitio gmail com
Kiran.abinitio rocketmail com
Lokesh.abinitio yahoo com
Venkat gmail com

14. Find the highest salary in the all records?


15. Find the highest salary in each deptnum for the all records?
16. Find the second highest salary for the all records?
17.Find the second highest salary in each deptnum for the all records?
18.Find the 5th highest salary in each deptnum?
19.Fin the 5th highest salary for the all records?
20.Find the lowest salary for all the records?
21.Find the lowest salary for each deptnum?
22.Find the maximum salary for each deptnum using Rollup?
23.Find the maximum salary for all records using Rollup?
24.Find the minimum salary for each deptnum using Rollup?
25.Find the minimum salary for all records using Rollup?
26.How many number of records present in the data?
27.How many number of records present in each deptnum in the data?
28.Find the average salary for each deptnum?
29.Find the average salary for all records ?
30.Third highest salary using Rollup?
31.Top ‘3’ salaries ?
32.How will you generate the rank system based on salary for the data?
33.How will you generate the rank system for the same salary?
34.How will you generate the rank system for each deptnum in the data?
35.I want 3rd maximum salary using Scan?
36.I want top 3 salaries using Scan?
37.I/P0: I/P1:

empnum ename deptnum salary deptnum deptid deptnam

401 ramana 20 80000 10 p101 sales


402 venkat 10 75000 30 p102 credit
403 kiran 20 65000 40 p103 debit
404 sai 30 70000 50 p104 intrst
405 lokesh 40 55000 10 p105 invoice
406 rahul 60 50000 90 p106 views
407 vamsi 50 45000 120 p107 profit
408 mani 30 50000
409 hari 60 40000
410 renu 10 57000

Perform all joins on above scenario?

38. I/P:

Snum m1 m2 m3 m4

10 10 20 30 40

20 80 70 60 50

30 40 30 50 80

40 90 100 110 120

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:

Balls runs over maxruns minruns totalruns

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?

43. I/P: O/P:

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

Solve Using join & without join?

47. I/P: O/P:

City col1 col2 col3

Hyderabad Banglore Chennai Hyderabad

Chennai Banglore Chennai Hyderabad

Banglore

Hyderabad

Chennai

Banglore

48. I/P1: O/P:

Alpha num column

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

51. I/P: O/P:


Col1 col2 col1 1234
1 a col2 abcd
2 b
3 c
4 d

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

53. I/P: O/P:


Code country code countries
1 india 2 indai,ap
2 ap 2 us,washington
1 us 2 uk,london
2 washington
1 uk
2 london

54. I/P: O/P:


abc a
abc b
abc c

55. I/P: O/P:


INDIA IIA

56. I/P: O/P:


Snum marks snum m1 m2 m3 m4
10 10,20,30,40 10 10 20 30 40
20 10,20,30 20 10 20 30 A
30 10,20 30 10 20 A A
40 10 40 10 A A A
57. I/P: O/P:
INDIA I
IN
IND
INDI
INDIA

58. I/P: O/P:


1 1
11
111
1111
11111

59. I/P: O/P:


ID sal ID sal
1 1000 1 6000
1 2000 2 18000
1 3000
2 5000
2 6000
2 7000

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

61. I/P1: I/P2:


Name friendname name
A ganesh A
A madhan B
B kiran C
C lokesh D

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

63. I/P: O/P:


ID Sal ID sal prevsal
101 500 101 500 0
102 800 102 800 500
103 900 103 900 800
104 200 104 200 900

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:

Custid custname product amount

111 kiran iphonex 36000INR

66. I/P: O/P:


abc cba
how will you reverse the string in reverse order?
67. If I have 10000 records how many records will goes to outport in rollup and scan?
68.How will you replace the string “alpha” in place of “omega”?
69.I have 2 multifiles with different columns if you combine the two files by using join component,graph will
execute or not?
70.How will you count the records in multifile?
71.If I have ‘100’ fields in a file and each have the one duplicate record,how will you remove that duplicate
record?
72. I/P0: I/P1:
empid empname deptnum sal empid empname deptnum sal
1 kiran 10 65000 3 ramana 30 70000
2 sai 20 60000 6 vikki 10 80000
3 ramana 30 75000 2 sai 10 72000
4 lokesh 40 50000 7 subbakka 30 55000
Perform join on above scenario?

73. I/P: O/P:


1 1 2 3
2
3

74. I have ‘4’ fileds Empid,Empsal,Empage. Evaluate below conditions


i)empsal less than 5 lakhs or age leesthan 30
ii)if empsal between 5 to 10 lakhs or age between 30 to 50
iii)if age greaterthan 50 or sal greaterthan 10lakhs
75. I have 100 records in first run I need 1-25 records

in second run I need 26-50 records

in third run I need 51-75 records

in fourth run I need 76-100 records.

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

20-40 ----->3rd partition

remaining ------>4th partition


84. Satish Konda how to find out O’s using in Abinitio?

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

88. How will you achieve the below scenario

I/File O/P File


EMPno Empname Deptno
EMPno Empname deptno

1 Anu 10
1 Anu 10
1 Anu 10
2 Bapu 20
2 Bapu 20

2 Bapu 20

89. I/P: O/P:


1 1
2 2
2
90. I/P: O/P:

cust_id trans_amt cust_ID trans_amt

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:

empid salary month


1 5000 jan
1 3000 feb
1 7000 march
2 15000 jan
2 13000 feb
2 17000 march
How will find second highest salary for every empid?

94. i/p0: I/P1:


111 11
How many records are go to output for all types of join?
95. i have 87 records I want to devide those in 10 in each output file how can u do ? if done how many
records ur last output file contains?
96. I/P:
1

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

100. I/P: O/P:


ramana ramana 1

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 ?

105. How to insert header and trailer records?

106. How to filter the records by using Reformat?

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?

114. I have fields like a10 b20 c123


If we give numeric value (any number) as key in sort component, what would be the expected result?
Do we get a sorted order? or Does the sort component spits an error?

115. I have 1 TB of record with below format:


CUST_ID
CUST_NAME
GENDER
MOBILE_NO
AGE
I want to fetch max age from each Gender group by only using Reformat component. How to achieve this?

116. How to Split a 10 GB file into 10 files of 1 GB in Ab initio?

117. I have customer details as below,

cust_card_no item amount


10001 pen 10
10001 copy 20
10001 pen 10
10001 copy 20
10001 copy 20
now my question is to find the distinct count of item per customer and total ammount spend by a customer?
118. I have data like below.
source file: Lookup File: Output file:
EmpID sal EmpID EmpID sala
A 1000 A C 3000
B 2000 B D 4000
C 3000
D 4000
I want empId, sal of employees those not present in lookup file?

119. I/P: O/P:


SiteId AcctId Address AcctId NoOfSites
675765 1 Smit Street 1 3
768768 2 Orange Road 2 2
767876 1 New Road 3 1
989898 1 Jones Street
878787 3 Ele Lodge
118768 2 Red Street

120. How to Join Data from Two Partitions of a Multifile in Abinitio.


I have a multifile having 8 partitions.
I want to join partition 1 and partition4 data.

130. How to generate sequence number in a multifile using next_in_sequence()?

131. Input file ----100 records.


A) Using a rollup,how many records will you get?
B) How can I get more than 100 records?
C) How can I get 1 record?

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?

134.I having 1000 records in in0 file.


i want first 250 records into out0 file,
next 250 (250 to 500)records into out1 file,
next 250(500 to 750) records into out2 file,
last 250(750 to 1000) records into out3 file using partition components?

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?

139. How to filter the records by using Reformat?

140. How to calculate the total number of records in the file using REFORMAT instead of ROLLUP?

141. Give examples for pipeline, component and data parallesim?

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.

You might also like