Thursday, February 28, 2013

Unix Script to Copy a file in Informatica

Lets now see the steps involved in Copying a file and placing in a destination required using the unix script from informatica.

1) Create a command task in your workflow or Open the Pre session command/post session command Of your Session property.

2) Now Provide the Script name in the space provided where we are going to place our unix script to do the above job. Script name should be given in the following way :

sh pathname/filename.sh

3) Now , Write the following script into the Script file to obtain the required result

. OSPENV
cp pathname/filename pathname/filename

4) Execute the script by running the workflow in informatica to see the required result.



Unix Script to Create a empty file in Target

Lets see the steps involved in creating a empty file in the target folder using the unix script.

1) Create a Command Task in the Workflow
2) Provide the Command name and Script file name in the Space provided. This will call the script during run time .
3) Now Write the following Unix script in the Script file .

. ospenv
Touch Filepath/filename

4) The above command will create a 0kb empty file in the target folder specified by us.

Saturday, February 23, 2013

Pre Session Command in Informatica

Lets see how Pre session command can be given in a Informatica Workflow.


The Below Screen shows a session where the pre session command is going to be added.

Now right click on that session -> click on edit

Now click on Components tab
We can see many Properties under this tab. Now select "Non Reusable" option from the drop down next to Pre session command property.
Now Select the Pencil mark present in Value column to specify the command script which we are going to use.
Click on "Add new command" button and specify the path and name of the script in the space provided
Now Click on "Apply" and "Ok".

Based on the Order we have given , the Command Scripts get executed before the Start of the session.
We can have as many scripts as we want (commands) to be run be run before session.

Pls chk our : Post Session command





Thursday, November 15, 2012

scenario6

I have a scenario where i need to load a table called "name_address" first for storing all the claimant name with a generation of a number (using given formula).

This number will be used in other main tables like claim table , transaction .. etc

Can u please help me whether constraint based loading will be useful or i need to specify target load plan.

Scenario5

Source              
Col_1    Col_2       
D1       A1          
D1       A2          
D2       A3         
D2       A4           

D2       A5           
D3       A6           
D3       A7 


Target 
Col_1    Col_2   
D1     A1-A2 
D2    A3-A4-A5 
D3     A6-A7


Answer :

The Following can be obtained by using a Sorter transformation , Expression transformation and a aggregator transformation.

Let me show the mapping now.,
This shows the mapping for the above scenario.
Now lets see them in detail
1) Usual Sorter on Col1
2) Expression t/f like below
3) Aggregator t/f as below

Create different flatfiles as output

We have a scenario in our project where i have to create different flatfiles as output based on the company number

The issue is 
1) we run this workflow once in every month
2) New company numbers and corresponding records may be added anytime during the month ., So each time wen a company is added we have to create a flatfile for that also
3) The name of the flatfile should be "Loss history report for" + company number
4) One more thing is every month wen the workflow runs , the flatfiles have to be places in that month folder . eg : In january the files shud be placed in Jan2012 folder.
The folders will be already present.,
5) Is it possible to create the folders also inside target every month ?

Does anyone have answer for this?


Wednesday, November 14, 2012

Java Transformation scenario2

Here i will show the mapping for scenario where we need the input records from emp table to be inserted into target thrice.

  


One more requirement is to change ename to "java" || job

They both are implemented the below way :


check out this link for other java scenario