Showing posts with label Scenario. Show all posts
Showing posts with label Scenario. Show all posts

Thursday, 22 December 2016

DataStage Scenario #17 - Get Transitive relation between columns


Goal : To get the data from two columns which have transitive relationship between them

A -> B
B -> C

then 

A -> C



Input
Col1 Col2
a b
b c
s u
u p
1 2
2 3






Output
Col1 Col2
a c
s p
1 3




Like the below page to get update  

Monday, 12 September 2016

Python Points #15 - Exceptions

Wednesday, 20 April 2016

Shell Script Scenario #8 - Odd and Even No



 Write a shell script to find whether an input integer is even or odd. 








Like the below page to get update  
https://www.facebook.com/datastage4you
https://twitter.com/datagenx
https://plus.google.com/+AtulSingh0/posts
https://datagenx.slack.com/messages/datascience/

Monday, 18 April 2016

10 Scenario based Interview Questions #2 - DataStage



11. Design a job which insert the data if not exists and update if exists in target
12. Design a job which includes a header and footer in output file
13. Design a job which checks whether Currency data is having 'Rs. 9999.99' format or not.
14. Design a job which checks the date passed validation. Date input in YYYYMMDD format.

For more ->  DataStage Scenario

15. Design a job which check the date difference in Hrs and Mins ( HH:MM)
16. Design a job which delete the data if exists in target first and then load.
17. Design a job which check whether each column is having a value or not
18. Design a job which populate the Date dimention table.
19. Design a job which transpose the columns into row with the help of transformer stage.
20. Design a job which remove duplicate without using Remove Duplicate Stage.


For more ->  DataStage Scenario



Like the below page to get update  
https://www.facebook.com/datastage4you
https://twitter.com/datagenx
https://plus.google.com/+AtulSingh0/posts
https://datagenx.slack.com/messages/datascience/

Monday, 4 April 2016

DataStage Scenario #16 - Cross duplicate Removal


Need to remove duplicate where source or destination can be switched.


Input:


source   destination   distance
city1 city2 500
city2 city1 500
city3 city4 500
city4 city3 500 
city5 city7 700
city7 city5 700



Output:

source   destination   distance
city1 city2 500
city3 city4 500
city5 city7 700





Like the below page to get update  
https://www.facebook.com/datastage4you
https://twitter.com/datagenx
https://plus.google.com/+AtulSingh0/posts
https://groups.google.com/forum/#!forum/datagenx

Monday, 28 March 2016

10 Scenario based Interview Questions #1 - DataStage


1. Design a job which convert single source row to three target row.
2. Design a job which can identify the row if they are duplicate in input.
3. Design a job which will fetch the input file header and footer.
4. Design a job which will segregate unique and duplicate records in different files.
5. Design a job which remove the header from the input file.

For more ->  DataStage Scenario
6. Design a job which remove the footer from the input file.
7. Design a job which throw a mail if footer is not there in input file.
8. Design a job which extract the alternate records from the input file.
9. Design a job which extract the Nth row from the input file
10. Design a job which extract data from two input files and load them in alternate in target.


For more ->  DataStage Scenario

Tuesday, 23 February 2016

DataStage Scenario #15 - Get First & Last Date of Last Month



Design a job which can generate the First and Last date of Last Month and pass this into an SQL which executes inside a parallel job?









Like the below page to get update  
https://www.facebook.com/datastage4you
https://twitter.com/datagenx
https://plus.google.com/+AtulSingh0/posts
https://datagenx.slack.com/messages/datascience/

Friday, 5 February 2016

DataStage Scenario #14 - Get Day specific file



Hi Guys,
Design jobs for one more realtime scenario -


Requirement-
Job will run once in a day, which read a file from a folder, but filename is changing on each day.

File Name -- FileName_Date.txt

Here -
Date -  Job run date
File - File Name


Example -

FileName on Monday -   InfoSphere_20160201.txt
FileName on Tuesday -   Info_Search_20160202.txt
FileName on Wednesday -   InfoLables_20160203.txt
FileName on Thursday -   InfoLocation_20160204.txt
FileName on Friday -   InfoOptions_20160205.txt




Like the below page to get update  
https://www.facebook.com/datastage4you
https://twitter.com/datagenx
https://plus.google.com/+AtulSingh0/posts
https://datagenx.slack.com/messages/datascience/

Thursday, 4 February 2016

DataStage Scenario #13 - Validate Decimals



Input:

Data
1 2 3 4. 345
423 4w 4232.23
42342.43243
56765.74 545
4 4o 646. 4343
3232. 4232
f432 4.6 66
43 4 6 4.3 3



Expected Output:

Data Valid
1234. 345 1234.345
4234w4232.23     0
42342.43243 42342.43243
56765.74 545 56765.7455
4 4o 646. 4343 0
3232. 4232 3232.4232
f432 4.6 66 0
43 4 6 4.3 3 43464.33




Like the below page to get update  
https://www.facebook.com/datastage4you
https://twitter.com/datagenx
https://plus.google.com/+AtulSingh0/posts
https://groups.google.com/forum/#!forum/datagenx

Friday, 22 January 2016

Shell Script for getting lines after and before of search String




Sometime when we search some text string in Unix environment we need those strings also which come before or after that searched string.
This below small shell-script gives same output and return output in one file depends on user choice that how many no. of lines user wants to print after and before any searched string.





This script take input as search string and no. of line you want to print before and after search result line and give output in search.txt






Like the below page to get update  
https://www.facebook.com/datastage4you
https://twitter.com/datagenx
https://plus.google.com/+AtulSingh0/posts
https://groups.google.com/forum/#!forum/datagenx

Wednesday, 13 January 2016

DataStage Scenario #12 - Combine data column wise



Col1 Col2 Col3
1 2 3
4 5 6
7 8 9



Col4 Col5 Col6
a b c
d e f
g h i



Col1 Col2 Col3 Col4 Col5 Col6
1 2 3 a b c
4 5 6 d e f
7 8 9 g h i




Like the below page to get update  
https://www.facebook.com/datastage4you
https://twitter.com/datagenx
https://plus.google.com/+AtulSingh0/posts
https://groups.google.com/forum/#!forum/datagenx

Monday, 11 January 2016

Cartesian Join - A Quick DataStage Recipe


What to Cook:
How to do Cartesian join -> Join every row of a table to every row of other table





Ingredients:
Use "column generator" stage

How to Cook:
Add both tables in DS job
Add dummy column using "Column Generator" stage each for both tables. Make sure dummy column values are same.
Join both tables using these  dummy columns






Like the below page to get update  
https://www.facebook.com/datastage4you
https://twitter.com/datagenx
https://plus.google.com/+AtulSingh0/posts
https://groups.google.com/forum/#!forum/datagenx

Friday, 11 December 2015

DataStage Scenario #11 - Get numeric or alphabets only



Goal - Extract numeric part and alpha part from a string as below

Input:

Source
ATUL1234
SINGH374
I23S
C343LEAR





Output -

Source Part1  Part2
ATUL1234 ATUL 1234
SINGH374 SINGH 374
I23S IS 23
C343LEAR CLEAR 343








Like the below page to get update  



Wednesday, 25 November 2015

DataStage Scenario #10 - two realtime scenario



Hello guys, Hoping you are enjoying while solving DataStage Scenarios. Today I am going to ask two real time scenario. try to solve these :-)

Scn1:
We have to design a job, which will extract data from table tab1, when we get some value in a file file1. No relation between table and file.
Simple Hhh? Let's make it little restricted. You can not use the sequencer job, All functionality we need in a single parallel job.





When you able to solve first one, come to this -

Scn2:
Reading source table Stab which is having 20 columns (Sc1, Sc2, Sc3.... ), Need to validate individual column from Sc1 to Scl0 from another table Rtab column Rc1 to Rc10 ( means Sc1 with Rc1, Sc2 with Rc2 .........). The condition is, If any column is got invalid whole row will be dropped and that column captured in a single reject report. Design such a way that we should get two rows in reject file if two column are not valid in a single input row.

Wish you a luck !!



Like the below page to get update  
https://www.facebook.com/datastage4you
https://twitter.com/datagenx
https://plus.google.com/+AtulSingh0/posts
https://groups.google.com/forum/#!forum/datagenx

Sunday, 15 November 2015

Shell Script Scenario #7 - Anagram words



Two words are called Anagram when you can rearrange the letters from one to spell the other.
i.e. -
Coat and Taco
Heater and Reheat
Cloud and Could

So, write a script which accept two input from user and return a result whether they are anagram or not ?





Like the below page to get update  
https://www.facebook.com/datastage4you
https://twitter.com/datagenx
https://plus.google.com/+AtulSingh0/posts
https://groups.google.com/forum/#!forum/datagenx

Monday, 9 November 2015

DataStage Scenario #9 - Add Header & Trailer



Scenario:
         Design a job to add Header and Trailer to input data.

Example Input:

Atul
Neeraj
Anita
Amruta
Divya
Swapnil
Pramod
Vivek
Ashish
Amit
Santosh



Output

Employee Name
Atul
Neeraj
Anita
Amruta
Divya
Swapnil
Pramod
Vivek
Ashish
Amit
Santosh
Employee Count : 11

Wednesday, 21 October 2015

DataStage Scenario #8 - Populate date between given two



Scenario :

Design a job with 2 job parameters -



1. Start Date   ( DD-MM-YYYY )
2. End Date  ( DD-MM-YYYY )

Read the parameter and populate all the date between these 2 which is not "SUNDAY"





Like the below page to get update  
https://www.facebook.com/datastage4you
https://twitter.com/datagenx
https://plus.google.com/+AtulSingh0/posts
https://groups.google.com/forum/#!forum/datagenx

Wednesday, 14 October 2015

DataStage Scenario #7 - Count data in each column


Count the total rows and cells which is having some data in it.





Input:

col1 col2 col3
 a {NULL} b
f k {NULL}
h {NULL} n
i d {NULL}
{NULL} s {NULL}
g u m
l x o
m {NULL} {NULL}
c d z



Output:

Count Rows Count_col1 Count_col2 Count_col3
9 8 6 5





Like the below page to get update  
https://www.facebook.com/datastage4you
https://twitter.com/datagenx
https://plus.google.com/+AtulSingh0/posts
https://groups.google.com/forum/#!forum/datagenx

Wednesday, 7 October 2015

Shell Script Scenario #2 - Solution


You can find other scenarios HERE



==================================================================================
==================================================================================





Like the below page to get update  
https://www.facebook.com/datastage4you
https://twitter.com/datagenx
https://plus.google.com/+AtulSingh0/posts
https://groups.google.com/forum/#!forum/datagenx

Wednesday, 30 September 2015

Shell Script Scenario #5 - Letters order




Design a script to get below output -
Requirement - Check whether all the letters in word is in order or not.

Data:
almost
cereal




Output
almost is in ORDER
cereal is not in ORDER 


For more scenario -  CLICK HERE