What is Host Program? How to create Host Program? and What is .Prog file?

To run a unix based shell script as a concurrent program, the executable of the concurrent program should be registered as a ‘Host’ program.

The execution file name of the host program should end with .prog extension and a soft link should be created for the .prog file.

Here is an example of creation of host program with one parameter:
Step 1:
Create a prog file XX_TEST_HOST_PROG.prog as shown below

#=======================================================================
# Program	: XX_TEST_HOST_PROG.prog 
# Description   : Host program example to print $0 to $4 parameters
# Author    	: Shailender Thallam
#=======================================================================
#
#Parameters 0 to 4 are default parameters and values are 
#passed from Concurrent manager
#
echo "0 Shell script name along with Path 	: " ${0}
echo "1 Oracle Apps User Name and Password 	: " ${1}
echo "2 Application user_id from FND_USER 	: " ${2}
echo "3 Application user_name from FND_USER     : " ${3}
echo "4 Concurrent Program Request ID	        : " ${4}
#
#Parameters from 5 are concurrent program parameter
#
echo " "
echo " "
echo "5 Concurrent Program Parameter 1 	    : " ${5}
 
#End of script

Step 2:
Upload the .prog file to the bin folder of respective application top and give necessary file permissions

Step 3:
Create Soft Link:

ln -s $FND_TOP/bin/fndcpesr  XX_TEST_HOST_PROG

Soft link will be created against fndcpesr so that concurrent manager will recoganize as host program.



Step 4:
Create Executable and Concurrent Program

Run the Host Program

Program Output

Why should we create host program executable file with .prog extension?

We can even a create the executable file with .sh extension but the concurrent manager will not pass any default parameters. Concurrent manager will pass default parameters only to the host program executable with .prog extension. Below are 5 default parameters of a host program, whose values are passed by concurrent manager

The first five parameters refer to the following:

$0: The shell script to be executed
$1: Oracle user/password
$2: Applications user_id
$3: Application user_name
$4: Concurrent program request_id

The parameters which we have on the concurrent program can be accessed from $5

Note: It is always suggestible to access parameters in this format ${0} rather than $0. The reason behind this is, the shell script wont recognize double-digit parameter when accessed in this format $10, so we need to use ${10}