Search This Blog

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