Monday, August 5, 2019

Unix Interview Questions

* Command to get Header in unix 
'Head' is used to get header in a file

* Command to check the status of your job 
'Jobs' Command

* Command to stop current task 
'Ctrl+z' Command 

* Command to get current task to back ground
'Bg Jobname' Command

* Command to bring back ground process to fore ground
'Fg Jobname' Command

* Command used to search a string in a file
'Grep' is the command used to search a string in a file.

* SED, AUK command in unix ?

* Have you worked on shell script ?

* Unix command used to save 
Ctrl+D is the command used to save file

* Unix command to clear screen
Ctrl+L command is used to clear screen

* Unix command to display unique line
uniq myfile.txt

* Unix command to display duplicates
uniq -D filename is used to display on duplicates

* 'Touch filename' command result if file already exist
When you run touch on an already existing file, the file's access and modification timestamps are updated to the current time. 

* How to display hidden files
Ls -a

* Command used to kill the running task
Kill or Kill -9

* How to find PID of the process 
PID means process id, unique number of the process. 
PS -EF is used to find pid of the process.

* Command used to transfer files from one server to another server  
FTP command is used

* Command used to know how long server is running
UPTIME command is used

* How do you truncate a file in unix ?
truncate -s 0 filename is used to truncate a file. Here -s means size, 0 is the value of the file to be set. 

* Which unix command is used to enter text at the end of the file?
$ echo "Hello World" >> file.txt 
$ cat file.txt
This is the first line. 
Hello World


* IF FILE IN UNIX CAN'T OPEN, BECAUSE OF NO PERMISSION. HOW TO  RECTIFY IT ?
 

* IF FILE IN UNIX CAN'T OPEN BECAUSE ITS A BIG FILE. HOW TO RECTIFY IT ?
 


Tuesday, July 30, 2019

Basic unix commands

Basic unix commands :-  
--------------------------

* Man command:
  It will gives DESCRIPTION and options how to use any command.
  eg:- man ls
         man cat

* Pwd : 
   It displays Present working directory or current directory.

* Ls Command :
  The 'ls' command is used to list files and directories.
  ls -a list all files including hidden file starting with '.'.
  ls -d list directories - with ' */'.
  ls -l list with long format - show permissions.
  ls -F Append indicator (one of */=>@|) to entries.
  ls -lh This command will show you the file sizes in human readable format.
  ls -r list in reverse order.
  ls -i list file's inode(index) number.
  ls -ltr View Reverse Output Order by Date.
  ls -t sort by time & date.
  ls -n It is used to print group ID and owner ID instead of their names.
  ls -m A list of entries separated by commas should fill the width.
  ls -g This allows you to exclude the owner and group information columns.
  ls -q Force printing of non-graphic characters in file names as the character `?';.
  ls -Q Place double quotations around the entry names.


Cd directory_name : To change the current directory to another directory.

Cd .. : It brings you out from your current directory but takes you only 1 directory ahead.
Cd .. /.. : It brings you out from your current directory but takes you 2 directories ahead.
Cd ~ : It is used to go back to your default directory or location.
Cd - : It is used to go back to your current directory or location.

Who : It displays how many users are currently logged in.

Who -q : It displays how number of users are currently logged in.
Whoami : It displays user who is logged in.

Cal :- It displays current month calender.

Cal -y :- It displays current year calender.

Date : It displays day, month, time with minutes and seconds along with year.


Cat : It is used to create, display and append the files.

Cat > filename : It is used to create a new file.
(Cat > filename)

Cat filename : It is used to display a file.
(Cat filename)

Cat -n filename : It is used to display lines along with line numbers.
(Cat -n filename)

Cat filename1 > filename2 : It is used to create file2 and inserts file1 data into it 
(Cat filename1 > filename2)

Cat >> filename : It is used to append or combine files.
(Cat >> filename
or
Cat file1 file2 >> file3
Appending data to the existing file)

Touch : It's a command used to create empty file.

Touch file1 file2 file3 : It create 3 empty files.
Touch -a : It is used to display last accessed time.
Touch -m : It is used to display last modified time.

Stat filename : It is used to display last accessed, modified and changed details of a file.


Mkdir directory_name : It is used to create directories.

Rmdir directory_name : It is used to remove only empty directories.
Rmdir directory_name1, directory_name2, directory_name3 : It is used to remove only all the 3 empty directories.
Rmdir -i directory_name : It is used to remove directories with interactive mode.
Rmdir -r directory_name : It is used to remove non empty directories.

Mv : It is used to move or rename the files.

Mv oldname newname : It is used to rename the file.
(Mv filename filename1)

Mv file1 /user/ file1 : It is used to move file1 from current directory to user directory file1.

Cp : It is used to copy the file. By default it supports only files not directories.

Cp shell perl : It is used to copy the file shell into the file perl. Perl contains all the contents in the shell file.
Cp -r direct1 direct2 :  It is used to copy directory1 to directory2.

Wc -l filename : It is used to print line count.
Wc -w filename : It is used to print word count. 


* Cut Command :
  Extracts parts of each line of a file. It cuts out a set of bytes or characters or fields from each row of the file based on the delimiter 
  Process the file vertically as result of which it produces a single or multiple coulums in the output.
  Acts like a filter that processes the file and extracts columns from it

  -b Bytes; selects only these bytes
  -c Characters; select ony these characters
  -d Delimiter; use the mentioned delimiter
  -f Fields; select only these fields
 
   Syntax1:- cut -d ',' -f1 file1;
   Syntax2:- cut -d ',' -f2 file1;
   Syntax3:- cut -b1-5 file1;
  
   Output1:
   apple
  
   Output2:
   ball
   
   Output3:
   apple,b


* Paste Command: 
  It is used to merge contents of two files vertically.
   
  -d To change the delimiter specified character instead of default delimiter tab
  -s Used to join the multiple lines of the file(in parallel) using the delimiters specified.
 
   Syntax1:- paste file1 file2
   Syntax2:- paste -d "|" file1 file2
   Syntax3:- paste -s file1 file2
    
   Output1:
 apple,ball,cat,dog,elephant,fish,goat,hen,icecream,jeep apple,ball,cat,dog,elephant,fish,goat,hen,ice-cream
  
   Output2:
   apple,ball,cat,dog,elephant,fish,goat,hen,ice-cream,jeep|apple,ball,cat,dog,elephant,fish,goat,hen,ice-  cream
  
   Output3:
   apple,ball,cat,dog,elephant,fish,goat,hen,ice-cream,jeep
   apple,ball,cat,dog,elephant,fish,goat,hen,ice-cream


* Comm Command: 
  It compares two sorted files line by line and produces three column output, when no option were passed to it. Column one contains lines unique to file1, column two contains lines unique to file2 and column three contains lines unique to both the files.

  -1 Do not display column 1 (Lines unique to first file)
  -2 Do not display column 2 (Lines unique to second file)
  -3 Do not display column 3 (Lines unique to both file)
  
  --check-order Verify files are in sorted order
  --nocheck-order Ignore even if files are not in sorted order

    Syntax1:- comm -1 file1 file2
    Syntax2:- comm -2 file1 file2  
    Syntax3:- comm -3 file1 file2
   
  Output1:
  apple,ball,cat,dog,elephant,fish,goat,hen,ice-cream
  
  Output2:
  apple,ball,cat,dog,elephant,fish,goat,hen,ice-cream,jeep
  
  Output3:
  apple,ball,cat,dog,elephant,fish,goat,hen,ice-cream
  apple,ball,cat,dog,elephant,fish,goat,hen,ice-cream,jeep


* Diff Command:  
  It compare files line by line. 
  This command is used to get uncommon records between both the files.
  eg:- diff file1 file2
  
  Syntax1: 
  diff file1 file2
  Syntax2:
  diff Proverbs.txt Proverbs2.txt
    
  Output1:
  < apple,ball,cat,dog,elephant,fish,goat,hen,ice-cream,jeep
  ---
  > apple,ball,cat,dog,elephant,fish,goat,hen,ice-cream
  
  Output2:
  >  He who hesitates is lost
  >  Like father like son
  >  Fortune favours the brave


* Sort Command: 
  Sort rearranges the lines of a file such that lines appear in nummerical or alphabetical order. 
  If no options are given sorting is done as:
  Lines that egin with number will come before lines that begin with a letter
  Lines that begin with the lowercase letter will come before lines that begin with same letter in uppercase.  
  
  -t To specify the delimiter
  -k To specify starting and ending columns for sorting
  -r To sort in revers order
  -n To sort numerical data
  -u To remove duplicate lines
  -c To check the file is in sorted order or not (It will not sort file contents)
  
   Syntax1:- sort Proverbs.txt  
   Syntax2:- sort -r Proverbs.txt 
   Syntax3:- sort -u Proverbs.txt
   Syntax4:- sort -c Proverbs.txt
    
   Output1:
   Action speaks louder than words
   An apple a day keeps the doctor away
   An apple a day keeps the doctor away
   Better late than never
   Practise makes man perfect
   Sun sets in the west
   Sun rises in the east
 
   Output2:
   Sun rises in the east
   Sun sets in the west
   Practise makes man perfect
   Better late than never
   An apple a day keeps the doctor away
   An apple a day keeps the doctor away
   Action speaks louder than words
 
   Output3:
   Action speaks louder than words
   An apple a day keeps the doctor away
   Better late than never
   Practise makes man perfect
   Sun sets in the west
   Sun rises in the east
   
   Output4:-
   sort: Proverbs.txt:2: disorder:  Sun sets in the west


* Unique Command:
  It is used to eliminate or remove the repeated occurance of consecutive lines from the file. If same line is repeated more than once, but not consecutive, it willbe considered as two unique lines and hence not removed. If all the repeated lines of the file has to be removed, then the file has to be sorted before passing it to uniq command.

  -u Selecting non repeated lines 
  -d Selecting the duplicate lines
  -c    Counting the frequency of occurance.

   Syntax1:- uniq Proverbs.txt (one occurance of every records will appear here) 
   Syntax2:- uniq -u Proverbs.txt 
   Syntax3:- uniq -d Proverbs.txt
   Syntax4:- uniq -c Proverbs.txt
    
   Output1:
   Sun rises in the east
   Sun sets in the west
   An apple a day keeps the doctor away
   Practise makes man perfect
   Action speaks louder than words
   Better late than never
   
   Output2:
   Sun rises in the east
   Sun sets in the west
   Practise makes man perfect
   Action speaks louder than words
   Better late than never
 
   Output3:
   An apple a day keeps the doctor away
   
   Output4:-
   1 Sun rises in the east
   1  Sun sets in the west
   2  An apple a day keeps the doctor away
   1  Practise makes man perfect
   1  Action speaks louder than words
   1  Better late than never


* tr Command: Translating characters
  The tr command manipulates individual character in a line. It translates character by character.
  It translates each character of expression1 to its corresponding mapped character in expression2.
  It takes input only from standard input but not filename as an argument.

  -d deleting the characters
  -s compressing multiple consecutive characters (Squeeze Repeating Characters)
  -c complementing values of expression

   The following command is used to translate double quotes into single quotes.
Syntax1:- cat Proverbs.txt | tr -d apple
    Syntax2:- cat Proverbs.txt | tr [a-z] [A-Z] (It converts all the character to capital letters)
Syntax3:- echo 'TODAYYYY IIIS SOOO COOOLD ~' | tr -s 'A-Z' 'a-z'  

   The multiple consecutive characters 'T' in log file logs.txt can be squeezed to one character using option -s of tr command as shown below.
   tr -s 'T' < logs.txt
   
   Output1:
   Sun riss in th st
   Sun sts in th wst
   An   dy ks th doctor wy
   An   dy ks th doctor wy
   Prctis mks mn rfct
   Action sks oudr thn words
   Bttr t thn nvr
 
   Output2: 
   SUN RISES IN THE EAST
   SUN SETS IN THE WEST
   AN APPLE A DAY KEEPS THE DOCTOR AWAY
   AN APPLE A DAY KEEPS THE DOCTOR AWAY
   PRACTISE MAKES MAN PERFECT
   ACTION SPEAKS LOUDER THAN WORDS
   BETTER LATE THAN NEVER
   
   Output3:
   today is so cold 


* Rev Command : reversing the given text/line
  It is used to reverse the text/line character wise. It reverses the order of the characters in each line and prints to the standard output.
  
  Syntax1:- cat file1 | rev
  Syntax2:- rev Proverbs.txt
  
  Output1:- peej,maerc-eci,neh,taog,hsif,tnahpele,god,tac,llab,elppa
  
  Output2:
  tsae eht ni sesir nuS
  tsew eht ni stes nuS
  yawa rotcod eht speek yad a elppa nA
  yawa rotcod eht speek yad a elppa nA
  tcefrep nam sekam esitcarP
  sdrow naht reduol skaeps noitcA
  reven naht etal retteB 


* Grep Command :   
  The content of the file is processed line by line, to search for the pattern and the lines matching the pattern are displayed on the terminal.
  It is used to search for lines of text that match one or many regular expressions.
  
  -i
  -V
  -n
  -x
  -c
  -v 
  -l
  -f
  -E
  -P
  -A
  -B 
  -C
  
  Syntax:- grep apple Proverbs.txt
  
  Output:-
  An apple a day keeps the doctor away
  An apple a day keeps the doctor away


* FIND Command : 
  To find a file in a directory.
  
  Syntax:- find -name s1.sh
  

* Sed Command :
  It is used to replace any character in a file.
  
  Syntax:- sed -i 's/ /,/g' filename.txt
           sed -i 's/,/ /g' Proverbs.txt

  Without using '-i' in sed command, file will not change it's delimiter or character. Just result will be displayed with 2nd character. 























 

Unix Filters

List of Filters in Unix:-
-----------------------
$HEAD
$TAIL
$NL
$CUT
$PASTE
$SORT
$TR
$TEE
$SED
$GREP
$FGREP
$EGREP


$HEAD :- (These are line filters)
-------- 
Head filename : It always displays first 10 lines from a file 
Head -3 file1 : It displays first 3 lines.
Head -5 file1 : It displays first 5 lines.
Head -5v file1 : It displays first 5 lines along with the filename (here v indicates verbose).
Head -5 file1 file2 : It displays first 5 lines from both the files along with the filenames.


$TAIL :- (These are line filters)
-------
Tail filename : It always displays last 10 lines from a file 
Tail -3 file1 : It displays last 3 lines.
Tail -5 file1 : It displays last 5 lines.
Tail -5v file1 : It displays last 5 lines along with the filename (here v indicates verbose).
Tail -5 file1 file2 : 
Head -5 file1 | Tail -1 file1 :  It displays first 5 lines and then displays last line from the result of 5.


NL :- (Number lines of files)
------
Nl file1 : It displays line numbers in file1
Nl file1 > file2 : It redirects all the file1 information to file2.


CUT :- (It removes sections from each line of files)
------
Cut -d ',' -f 3 file1 : It displays only the 3rd field from the file1 (complete 3rd column is display). For delimiter separated fields, the -d option is used.
Cut -d ' ' -f 3 file1 : It displays only the 3rd field from the file1 (complete 3rd column is display). The default delimiter is the tab character.
Cut -d ',' -f 2,3 file1 : It displays only the 2nd and 3rd field from the file1 (complete 2nd and 3rd column is display).
Cut -d ',' -f 1,3 file1 : It displays only the 1st and 3rd field from the file1 (complete 1st and 3rd column is display).
Cut -d ' ' -f 1-3 file1 : It displays from 1st to 3rd field from the file1 (complete 1st to 3rd column is display).
Cut -c1,7 file1 : It displays first character and 7th character.
Cut -c1-7 file1 : It displays from first character to 7th character.


PASTE :- (It merges lines of files)
--------
Paste file1 file2 : It merges two files or it display both files side by side.
Paste -s file1 file2 : It merges two files or it display both files one by one.


SORT :-
-------
Sort file1 : It sorts fields from the file1.
Sort -r file1 : It sorts fields from the file1 in the reverse order.
Sort -n file1 : It sorts fields from the file1 in the numerical order, if the numeric data exits.
Sort -rn file1 : It sorts fields from the file1 in the numerical reverse order, if the numeric data exits.
Sort -ofile2 file1 : It sorts and outputs the fields of file1 in file2.


TR :- (Translate or delete characters)
-----
Tr 's' 'n' < file1 : It converts character S to N, where s is present from the file1.
Tr 'a-z' 'A-Z' < file1 : It converts all the small characters into Capital letters.
Tr 'aeiou' 'AEIOU' < file1 : It converts all the small letters vowels into capital letters vowels.


TEE :- (It reads from standard input and writes to standard output)
-----
Cal | Tee file1 : It takes input from cal and redirects to file1.
Wc -l file1.txt| tee file2.txt


SED :- 
------ 
(Sed command or Stream Editor is very powerful utility offered by Linux/Unix systems. It is mainly used for text substitution , find & replace but it can also perform other text manipulations like insertion, deletion, search etc. With SED, we can edit complete files without actually having to open it.)

Sed 2q file1 : It filters and displays only first two lines.
Sed -n 2p file1 : It filters and displays only second line from file1.
Sed -n -e 2p -e 5p file1 : It filters and displays only second line and 5th line from file1.
Sed 4d fruits : '4’ is the line number & option ‘d’ will delete the mentioned line number
Sed 3d fruits > newfile : '3’ is the line number & option ‘d’ will delete the mentioned line number and result will be display in newfile. 


GREP :- (Globally search for regular expressions)
-------
Grep Apple File1 : It displays lines with apple from the file1.
Grep column_name File1 : It displays column_name from the file1.
Grep -n column_name File1 : It displays number for column_name from the file1.


FGREP :- (Fast Globally search for regular expressions)
-------



EGREP :- (Extended Globally search for regular expressions)
-------


Sunday, June 30, 2019

Indirect File Method

Unlike Direct method, Indirect file method is used when we have multiple files and load them to single target. 

To configure Indirect method :-
----------------------------------
- Create a flat file and paste all the path of the flat files in it.


- Drag the one of the source definitions among the multiple flat files and develop code.
- In the session level properties, select the source types as 'indirect option' instead of direct.
- Give the path in source file directory.
- Give Common file name in source filename field.











Saturday, June 29, 2019

SCD Type 2 Flag

SCD Type 2 Flag is the method used to store historical data is maintained along with current data.


- Create a mapping and name it.
- Drag Emp source into the mapping area.
- Create a Lookup transformation on target table.
- On Primary key columns you should define your condition, because its the matching column between source and target.


- Create an Expression, drag the ports from lookup transformation and name as prev record. This tells us that records are old ones which are used to compare with new ones.
- Drag the comparision keys from source qualifier to Expression
- Create two ports as Newflag and Changedflag and give syntax as Isnull (Cust_key) and Not Isnull(Cust_key) and (Prev_Empn != Empno OR Prev_Ename != Ename OR Prev_Sal != Sal)



- First syntax will check for nulls. If there are null, lookup will insert data into the target table.
- Second syntax will  check for existing rows. If there are rows, lookup will update data into the target table.
- Create Filter1 and drag all the ports from source qualifier and give filter condition as NEWFLAG
- Connect update strategy and give the 'Update Strategy Expression' as DD_INSERT



- Create Filter2 and drag Cust key and comparision keys from source and give filter condition as CHANGEFLAG
- Connect update strategy and give the 'Update Strategy Expression' as DD_INSERT
- Create Sequence gen, connect it to Expression and connect the NEXTVAL port to CUST_KEY ports in both Target instances 1 & 2 
- Also create FLAG port, assign value 1 to it and connect port to both Target instances 1 & 2
- Create another Expression, drag CUST_KEY to it from Filter2 and create FLAG port, Give the value as 0.
- Create a new update strategy and give the 'Update Strategy Expression' as DD_UPDATE
- Make three instances of target, Connect update strategy 1 to target 1 and update strategy 2 to target 2, Connect update strategy 3 to target 3
- Here First pipeline inserts new data into the target, Second pipeline inserts changed data into the target where as Third pipeline updates changed data into the target. Connect only that ports which you want to insert and update in the target table
- Final mapping looks like below screen shot




Note 1 : Lookup condition should be on logical key column
Note 2 : lookup transformation should contain Logical key, Primary key & Comparison key columns.
Note 3 : Second pipeline in the mapping contains comparison key, primary key & changed flag columns.

Note 4 : Expression transformation should contain only primary key, comparision keys along with related source keys and new and changed flag.

SCD Type 2 Effective Date

SCD Type 2 Effective Date is the method used to store historical data is maintained along with current data.


- Create a mapping and name it.
- Drag Emp source into the mapping area.
- Create a Lookup transformation on target table.
- On Primary key columns you should define your condition, because its the matching column between source and target.



- Create an Expression, drag the ports from lookup transformation and name as prev record. This tells us that records are old ones which are used to compare with new ones.
- Drag the comparision keys from source qualifier to Expression
- Create two ports as Newflag and Changedflag and give syntax as Isnull (Cust_key) and Not Isnull(Cust_key) and (Prev_Empn != Empno OR Prev_Ename != Ename OR Prev_Sal != Sal)



- First syntax will check for nulls. If there are null, lookup will insert data into the target table.
- Second syntax will  check for existing rows. If there are rows, lookup will update data into the target table.
- Create Filter1 and drag all the ports from source qualifier and give filter condition as NEWFLAG
- Connect update strategy and give the 'Update Strategy Expression' as DD_INSERT



- Create Filter2 and drag Cust key and comparision keys from source and give filter condition as CHANGEFLAG
- Connect update strategy and give the 'Update Strategy Expression' as DD_INSERT
- Create another Expression, drag CUST_KEY to it from Filter2 and create END_DATE port. Give the syntax as SYSDATE.
- Create a new update strategy and give the 'Update Strategy Expression' as DD_UPDATE
- Make three instances of target, Connect update strategy 1 to target 1 and update strategy 2 to target 2, Connect update strategy 3 to target 3
- Here First pipeline inserts new data into the target, Second pipeline inserts changed data into the target where as Third pipeline updates changed data into the target. Connect only that ports which you want to insert and update in the target table
- Create Seq Gen and connect to Expression with BEGIN_DATE and assign value as SYSDATE. Connect it to Target instance 1
- Final mapping looks like below screen shot




Note 1 : Lookup condition should be on logical key column
Note 2 : lookup transformation should contain Logical key, Primary key & Comparison key columns.
Note 3 : Second pipeline in the mapping contains comparison key, primary key & changed flag columns.
Note 4 : Expression transformation should contain only primary key, comparision keys along with related source keys and new and changed flag.
















Monday, June 24, 2019

Normalizer Transformation

Normalizer Transformation is Active and Connected transformation. It converts single row data into multiple columns data. It converts de-normalized table into a normalized table. You cannot drag & drop columns to normalizer transformation like the rest of the transformations.

* Normalizer is used to convert rows into columns.
Normalizer is used in the place of source qualifier while reading mainframe or Cobal Source.

Steps to create Normalizer transformation :-
-----------------------------------------------------------------
- Go to tranformations tab and select normalizer
- Double click normalizer and select the normalizer tab
- Add the occurs based on the requirement







In Normalizer properties tab 'Reset' and 'Restart' are the two options available.

Reset is used to reset the Gk value to the value, that is used before the session.
Restart is used to start Gk sequence from 1 and restart for each session

There 2 important ports available and they are GK and GCID

GK generates sequence number starting from the value defined in the sequence field.
GCID hold the value of the occurrence field.




Sunday, June 23, 2019

Types Of Keys In Database

Primary Key :-
---------------
A primary key is a single field or combination of fields that uniquely identifies a row in the table.

The following are rules that make a column a primary key:
- A primary key column cannot contain a NULL value
- A primary key value must be unique within the entire table
- A primary key value should not be changed over time


Foreign Key :-
---------------
A foreign key means that values in one table must also appear in another table.
The referenced table is called the parent table while the table with the foreign key is called the child table.
The foreign key in the child table will generally reference a primary key in the parent table.


Natural Key and Surrogate Key:-
------------------------------------
Sometimes the primary key is made up of real data and these are normally referred to as natural keys, while other times the key is generated when a new record is inserted into a table.   When a primary key is generated at runtime, it is called a surrogate key.

A natural key is a single column or set of columns that uniquely identifies a single record in a table, where the key columns are made up of real data.  When I say “real data” I mean data that has meaning and occurs naturally in the world of data.  A natural key is a column value that has a relationship with the rest of the column values in a given data record.  

keys that don’t have a natural relationship with the rest of the columns in a table.  The surrogate key is just a value that is generated and then stored with the rest of the columns in a record. The key value is typically generated at run time right before the record is inserted into a table.

Sunday, May 26, 2019

Mapplet & Worklet

Mapplet :-
----------
If you want to create same logic in multiple mapping we use Mapplets. Instead of creating logic every time, we can create it in a single Mapplet and use it in many mappings.

- Go to Mapplet designer, create Mapplet input and output from transformations


- Apply the mapping logic between input and output Mapplet.


- Now apply this logic in mapping where ever there is requirement.



- If you want to show mapplet logic in the mapping just go to mapping click expand/unexpand option. Select correct one from the list of mapplets & click ok.



Worklet :-
----------
If you want to create dependencies between the workflows or sessions, we use worklets.
If you have many sessions in a mapping its very difficult to manage with dependencies, instead of adding dependencies among various session we use Worklets to make our work easy by creating dependencies among different Worklets.

- Create a worklet, name it and add connect sessions to it.



- Drag worklet from left and connect all of them together in the workflow designer.




Reusable Transformation :-
--------------------------------
If we want to use any transformation again & again in the mapping we can create reusable transformation. 

Double click  transformation & check option reusable to make it reusable transformation. 


We cannot edit it once its converted into reusable. We need to go to Transformation developer to change anything if required. If any transformation is created in Transformation developer it will be by default a reusable transformation














Date Functions in SQL

Select Getdate() as CurrentDate; Select Getdate() -1 PreviousDate; Select Getdate() +1 NextDate; Select DATEADD(dd,1,getdate()) as NextDate;...