We are going to do is, to call C++ Executable from Informatica, using Passive Java Transform and capture the output of the C++ using Java and write the result to corresponding target column.

There was a requirement to call a C++ executable binary from Informatica. The C++ program basically takes one input file name in the command line and calculates "value at risk" (VAR) values based on all the financial transaction records present in the given input file and outputs the final VAR value. This value along with other source data needs to be populated in the Target.

Here is the test environment setup.

  1. We have a source flat-file having 4 input columns out of which one column TCN bears the partial-filename which needs to be passed as argument to C++ executable.
  2. The C++ executable recieves the filename as arguments calculates the VAR for the corresponding file and outputs the VAR value.
  3. We capture the VAR value using the same Informatica Java Transform that calls the C++ executable and populate the corresponding target field.

Sample Source and Target Record.




Please find the Informatica Mapping and the Java Transformation properties below. Note the Java Transformation used is a Passive one.

Mapping to call C exec from Java

Java Ports Tab

Java Code- Import Packages

Java Code to call C++ executable

Find the corresponding Java Code.

String CPP_Exec = "C:\\Users\\Saurav\\My Documents\\calc_var.exe";
String ip_fname = InputTCN;
String filename = CPP_Exec + " " + ip_fname;
String op_VAR;
Process p = Runtime.getRuntime().exec(filename);
BufferedReader input = new BufferedReader (new InputStreamReader(p.getInputStream()));
while((op_VAR = input.readLine()) != null)
	VAR= Integer.parseInt(op_VAR.trim());
catch(Exception e) 

Finally we are done. Calling a C++ executable from Informatica using Java Transformation.

Have a question on this subject?

Ask questions to our expert community members and clear your doubts. Asking question or engaging in technical discussion is both easy and rewarding.

Are you on Twitter?

Start following us. This way we will always keep you updated with what's happening in Data Analytics community. We won't spam you. Promise.