Using Informatica Environment Variables

If you frequently use scripts to run PowerCenter commands pmrep and pmcmd, make sure you are using server environment variables for repetitive command parameters.

Benefits of using environment variables:

  • Eliminate the need to change scripts when migrating from test to production.
  • Reduce need to change scripts when upgrading to new version of PowerCenter.
  • Better security: user id and passwords will not be in clear text. Of course you will want to restrict who can edit the server's environment variables and limit who can place scripts on your server.
For the sake of brevity I will not explain how to setup server environment variables, your server administrator will know how to do that or you can search for step-by-step instructions on Google for your server type (Windows or Unix).

This article will present the material from a Windows server point of view and will cover:
  • Common environment variables for PowerCenter
  • Encrypting Passwords
  • Example usage in scripting
Common environment variables for PowerCenter
Here are some example env. variables you could define:
Variable Description
INFA_PM_PASSWORD encrypted password for workflow user
INFA_PM_USER user id of
INFA_SERVICE Integration service name
INFA_PATH path to PowerCenter server folders x:\Informatica\PowerCenterx.x.x
INFA_DEFAULT_DATABASE_PASSWORD encrypted password for repository database login
INFA_REPOSITORY repository name

The PowerCenter command reference guide has a chapter on configuring environment variables and a complete list of the variables you can use but you can add any number of variables to suit your specific needs.

Note, you may have to restart the PowerCenter services (or system) before new environment variables will be available.

Encrypting Passwords
Before you create an environment variable for a password, you should create an encrypted version of it using the PowerCenter command pmpasswd.exe.  The pmpasswd command creates an encrypted password that will be decrypted by the pmcmd and pmrep commands.

The command syntax is:

pmpasswd yourpassword -e CRYPT_SYSTEM
the returned "password" will look similar to: f/wRb5PZsZnqESTDPeos7Q==

To encrypt a password, open a command window on your server, then navigate to the PowerCenter \server\bin folder and execute the pmpasswd command.  Copy the resulting encrypted password from the command window and paste it into the value field of the Environment Variable dialog.  Now it can be referenced in a script without being exposed (as shown in the example below).

Example usage in scripting
Here is an example using environment variables in a simple "start workflow" script.  The environment variables are highlighted in bold.

First, this example sets the path for the script, then pmcmd command is called using the startworkflow function.

Notice some of the variables require the %varname% syntax but the user id and password variables do not.  When using the -uv and -pv options (as opposed to -u and -p), the pmcmd startworkflow function assumes the user id and password are stored in environment variables and knows now to retrieve them and decrypt the encrypted password.

SET PATH=%INFA_PATH%\server\bin;%PATH%

pmcmd.exe startworkflow -sv %INFA_SERVICE% -d %INFA_DEFAULT_DOMAIN% 
-wait wf_Test_MyWorkFlow

I hope you will give consideration to using environment variables. I also recommend you review PowerCenter's command reference guide and search the Informatica Knowledge base for more information.

If you would like to share your experiences or have questions about this topic, please leave a comment.

Thank you for your support
 or  PayPal

IMPORTANT, YOU are responsible for backing up your systems before trying or implementing any suggestions from this blog. I do not guarantee 100% accuracy in any code examples. I do not presume to know your system environment(s) or Security requirements; all code examples from this blog should be throughly tested before any attempted use on a production system.

11 Response to "Using Informatica Environment Variables"

  1. J. Kinzer 5/23/10, 5:08 PM
    Fill free to leave a comment, I would enjoy seeing your feedback.
  2. Anonymous 2/25/11, 4:21 AM
    In the example just before conclusion, should you not have % signs around the environment variables for user and password?
  3. J. Kinzer 2/25/11, 5:38 PM
    Thank you "Anonymous" for the comment. No those variables should not have % signs. As stated in the paragraph preceding the example:

    "Notice some of the variables require the %varname% syntax but the user id and password variables do not. When using the -uv and -pv options (as opposed to -u and -p), the pmcmd startworkflow function assumes the user id and password are stored in environment variables and knows now to retrieve them and decrypt the encrypted password."
  4. Anonymous 11/2/11, 9:08 PM
    Can we decrypt password and how?
  5. J. Kinzer 11/3/11, 7:05 PM
    No, I don't think they have a command to allow decryption. I saw something to that affect in one of the manuals.
  6. Anonymous 5/15/13, 4:44 PM
    Can we use encrypted password while using webservices to kick off the workflows?
  7. J. Kinzer 5/18/13, 5:03 PM
    I have not tried using engrypted passwords with Webservices, I assume it would work. It may depaned on how you start the work flow. Give it a try and let me know!!
  8. Anonymous 11/26/13, 10:05 AM
    I went to below folder and used command pmpasswd. its showing command not found
  9. Anonymous 11/26/13, 10:05 AM
  10. J. Kinzer 11/26/13, 10:43 AM
    re pmpassed not found. can you use Window Explorer to search the system to see of the utility is on the system. I can only speculate it's not installed or was removed my an administrator. Try contacting Informatica support to see how the utl could be installed or maybe they can give you a copy through your maintenance agreement.
  11. Teju Teju 5/21/18, 9:03 AM
    It is nice blog Thank you provide important information and i am searching for same information to save my timeInformatica Online Training Bangalore

Post a Comment