Posted on June 18th, 2007 by Sanjit Anand | Print This Post
|
Email This Post
Have you tried OracleappsHub in ipad/iphone/smart Phone? Don't wait. try it today |
These are the few steps which is required to make a host based Concurrent Program.
The first steps would be , you have to create a script and save as .prog extension and put into your application top bin folder.
If your custom application is XX then the scripts should goes to $XX_TOP/bin
For example, call the script CUSTOM.prog and place it under
Step 2
Now,you have understood , the execution of unix program is bit different in oracle application. The only things you have to notice is you need to pass 4 mandatory parameter to execute host program.
The other way around is ,you can use fndcpesr and link with your host program.It means the fndcpesr will take care of your 4 mandatory parameter.
You have to simply create a soft link with $XX_TOP/bin folder.
ln -s $FND_TOP/bin/fndcpesr
Your script will be passed at least 4 parameters, between $1 and $4.
These are:
orauser/pwd,
userid,
username,
and request_id
Any other parameters you define will be passed in $5 and higher.
Make sure your script returns an exit status also.
What additional piece need to incorporate in code
you need to simply
ORA_USER_PASS=$1
USERID=$2
USERNAME=$3
REQUESTID=$4
With or without extn '.prog'
You can register an host application without the prog extension. Your script will not have any extension. However in order to make this work you must have logic in your host application that parses the parameter string passed to it and extract the individual parameters out of it. This is required because the Concurrent manager passes 1 string containing all the parameters, to the host program. In programs linked to the fndcpesr
program, the fndcpesr parses it into the individual parameters.
How can you return an error status of the concurrent programs?
Yes, By default, a shell script returns success (status code 0). In case of error script traps an error, use the UNIX exit command 'exit 1' to return
failure (status code 1) to the concurrent manager running the program."
Final Note of 'fndcpesr'
fndcpesr is a standard utility available in $FND_TOP directory. Its mainly used by the application to parse arguments for shell scripts.
Related Posts
July 1st, 2007 at 12:21 pm
hi,
what if i require to run the shell scripti from another responsibility other than sys admin
Ranjith
July 2nd, 2007 at 1:14 am
Ranjith,
could you elaborate more….in term of clarity of the quetsion.
If you are trying to run from other responsiblity , simply attach that requset to requset group under which you are looking for.
take a note, Respoisblity is tied up with Requset group and menu, more over userid is tied with Resposniblity. There is only exception of not having requset group, when you will take alternate approch like FND_SUBMIT API’or submitting through CONCSUB..ie directly from host.
November 18th, 2007 at 11:07 pm
I am calling pl/sql procedure,from my shell method concurrent prog.
can i use fnd_file.put_line to log message ?
February 20th, 2008 at 12:58 am
As log file for Host concurent program contains output whichs is sent to stout from the shell script, I think you have to use for example dbms_output.putline to write log messages. have to check
April 1st, 2008 at 2:57 pm
I use a shell script without extension and I have two custom parameters defined in the concurrent manager. I’m able to get the values through my shell script, by reading the whole parameter list and parsing it. However, the parameters are encolosed with double quotes which is causing issues. How do I get rid of the double quotes surrounding my parameters?
Help is greatly appreciated.
April 1st, 2008 at 11:30 pm
Hi,
I want to pass 7 parameters to my Shell Script program by using Concurrent Program in Oracle Apps. While i try to Run the program. it didn’t pick the parameters correctly. I use the code in my Shell Scripts are:
l_to_mail_id=$5
l_cc_mail_id=$6
l_file1_path=$7
l_file1_name=$8
l_file2_path=&9
l_file2_name=&10
l_subject=$11
But its not working fine. Please help me to correct this.
Thanks in Advance.
Regards,
Senthil Kumar.K
April 2nd, 2008 at 3:40 am
there should be no problem ….as far as you attached with fndcpesr by mean of soft line…
additionally you can pass as many parameter as you can….the more over you need to check the corresponding mapping..
I will check my script, will send you offline
April 6th, 2008 at 8:16 am
Senthil,
I guess u have problems catching $10, $11 values.
These should be ${10}, ${11} and so on.
Try it.
regards,
Rajkiran.
May 15th, 2008 at 8:19 pm
How to get program status or “WARNING” in host method concurrent program?
June 1st, 2008 at 5:50 am
Hi,
We have two servers, database node and application node. Concurrent Service is installed on Database Node. I want to write a program to Load the data using SQLLOADER, which I am invoking using Host File. For this program, data file will be residing on Application Node. But as Concurrent Service is on Database Node, I want to know, if I can still run host executable file from application node.
Regards,
Martand Joshi
July 15th, 2008 at 12:43 pm
I have similar problem as Amresh.
Can some one shed some light on
how to get program status or “WARNING” in host method concurrent program?
Regards,
Raj.
August 29th, 2008 at 7:48 am
Hi,
I have a simple CC Program which execute a shell script. After the execution the Log files are not created but the ‘echo’ commands are not displayed. I have used a simple echo “Hello World”, even that is not getting displayed in the Log. Please advice
thanks
Anil Krishnan
September 1st, 2008 at 8:19 am
Dear Sanjit,
As per your saying, i added to my test_data_host_prog.prog file four compulsory parameters ,but during registration in sysadmin -> concurrent-> program -> define
,in parameters window i had left all blank.
During running of the concurrent program it is giving error: The executable file /dev02/CPS/apps/apps_st/appl/ja/12.0.0/bin/test_data_host_prog for this concurrent program can not be executed.
my script file is as follows:
# Parameters passed into program
ORA_USER_PASS=$1
USERID=$2
USERNAME=$3
REQUESTID=$4
#LOGON_STRING=’apps/appscps@cps’
#FILENAME=$5
sqlload userid=apps/appscps@cps control=/usr/tmp/test_data_host.ctl data=/usr/tmp/test_data_host.txt log=/usr/tmp/test_data_host_log.log bad=/usr/tmp/test_data_host_bad.bad ERRORS=100000 silent=FEEDBACK <<!
!
RC=$?
echo “The sql loader exit code for loading Header table is :”$RC
if [ $RC -eq 0 -o $RC -eq 2 ]
then
echo ‘Loading of file table successful.’
else
echo ‘Error: Loading of file table has errors. Sqlload return code is ‘$RC
exit 1
fi
case “$RC” in
0) echo “SQL*Loader execution successful” ;;
1) echo “SQL*Loader execution exited with failure, see logfile” ;;
2) echo “SQL*Loader execution exited with warning, see logfile” ;;
3) echo “SQL*Loader execution encountered a fatal error” ;;
*) echo “unknown return code $RC” ;;
esac
kindly help me with the same.
Thanks & Regards
Vishnu Pratap Patel
September 2nd, 2008 at 1:33 am
hello all,
Dear Friends, i want to use host command in a concurrent request to load data in a table from a flat file .
for that i wrote one flat file(test_data_host.txt) , one control file(test_data_host.ctl) , one script file(test_data_host_prog.prog)
Finally i made one concurrent program BPIL_TEST_DATA_HOST and saved it as ‘ HOST ‘.
i added to my test_data_host_prog.prog file four compulsory parameters ,but during registration in sysadmin -> concurrent-> program -> define ,In parameters window, i had left all blank.(previously, same was running when i made one link from ‘$FND_TOP/bin/fndcpesr’ file using command: *ln -s $FND_TOP/bin/fndcpesr test_data_host_prog * through telnet.)
During running of the concurrent program it is giving error: The executable file /dev02/CPS/apps/apps_st/appl/ja/12.0.0/bin/test_data_host_prog for this concurrent program can not be executed.
my files data is attached here with:
1) test_data_host.txt file:
Tamojit,1,history
Vishnu,2,maths
Krishna,3,HRMS
*******************
2) test_data_host.ctl file:
LOAD DATA
APPEND
INTO TABLE BPIL_TEST_CONTROL_FILE
FIELDS TERMINATED BY “,”
OPTIONALLY ENCLOSED BY'”‘
TRAILING NULLCOLS
( name1,
class1,
subject,
record_status CONSTANT ‘NEW’)
*******************************
3) test_data_host_prog.prog file:
# Parameters passed into program
ORA_USER_PASS=$1
USERID=$2
USERNAME=$3
REQUESTID=$4
#LOGON_STRING=’apps/appscps@cps’
#FILENAME=$5
sqlload userid=apps/appscps@cps control=/usr/tmp/test_data_host.ctl data=/usr/tmp/test_data_host.txt log=/usr/tmp/test_data_host_log.log bad=/usr/tmp/test_data_host_bad.bad ERRORS=100000 silent=FEEDBACK <<!
!
RC=$?
echo “The sql loader exit code for loading Header table is :”$RC
if [$RC -eq 0 -o $RC -eq 3 |http://forums.oracle.com/forums/]
then
echo ‘Loading of file table successful.’
else
echo ‘Error: Loading of file table has errors. Sqlload return code is ‘$RC
exit 1
fi
case “$RC” in
0) echo “SQL*Loader execution successful” ;;
1) echo “SQL*Loader execution exited with failure, see logfile” ;;
2) echo “SQL*Loader execution exited with warning, see logfile” ;;
3) echo “SQL*Loader execution encountered a fatal error” ;;
*) echo “unknown return code $RC” ;;
esac
kindly help me with the same to run the concurrent request successfully to load the data .
Thanks & Regards
Vishnu Pratap Patel
(vishnu.patel@tcs.com)
September 5th, 2008 at 8:15 pm
echo should work.what is version of your oracle u are using.
Command like
echo “Line 1.”
echo “line 2.”
suppose to print
Line 1.
Line 2.
in log file.
are u sure prog completed successfully. some time access previlege also causing , as there is no debug options unless developer is realize that something pre-requssite is not performed yet.
this is simple host based concuuurent prog used to Moves files from one directory to another
Three input parameter is there.
once you put the script in to Unix box, donot forgot to run this command
ln -s -f $FND_TOP/bin/fndcpesr XXTEST
–here is code
September 5th, 2008 at 8:33 pm
Dear Vishnu,
there should not be any issue.
errors message seems there need a proper access on file in unix.
Do a quick check
1. when create a soft line you should do like
2. Make sure soft link is create or not
3. Make sure you should have proper access on the site.
When you are calling sqllodaer from its better use directly from home and just pass userid which internally passed by fndcpesr prog.
and you can see how these are derived from parameter
Let me know , in case if this does not work, I will send you code.send me offline message.
September 23rd, 2008 at 3:18 am
Hi,
this tutorial is perfect, thank you for your information.
Do you have an example of a host program which would ftp a file from the apps server to a remote ftp server?
October 10th, 2008 at 11:54 am
How to send the status as WARNING for a HOST concurrent program
November 30th, 2008 at 8:26 pm
I need the same for r12…. It seems that something was changed…
Best Regards,
Marcelo
December 8th, 2008 at 9:51 pm
Hello to all,
Same as Marcelo, my host-based concurrent program which is working in 11i is not working in R12. Anyone know what’s the reason?
Thanks in advance,
Mervin14
December 9th, 2008 at 4:28 pm
Marcelo ,Mervin
There is no such difference in R12 and R11i of the host program based concurrent program.
I am suspecting either your softlink is not created or loader file path is not correct.
Are u getting some message or your program is ending with red color error.
Could you share your log file offline at sanjitanand@yahoo.com, and if posssible share the screen snapshots of
1. Concurrent registration of prog
2.screen snap shots of $FOLDER/bin
i want to make sure privileges
3.log file of the concurrennt program
December 18th, 2008 at 3:11 am
Yeah, I also have the same problem.
It doesn’t seem to work in r12.
Also how do I check the loader file path
December 18th, 2008 at 3:40 am
Got it resolved.There was something wrong with the fndcpesr file itself in r12.
Took the fndcpesr file from an r11 instance and copied it into r12 $FND_TOP/bin/ and renamed it to fndcpesr1.
Then created the link to this file.
It works!!!
January 13th, 2009 at 5:57 am
I have to print output in output file instead of log file.What i have to do for that.
March 26th, 2009 at 1:05 pm
To write to output, find the name of the output file by querying FND_CONCURRENT_REQUESTS in the shell script. Then redirect your output and append it to the output file.
June 1st, 2009 at 9:44 am
Hi I ran the concurrent program, and it completed normally. Now i want to know the given parameter name and value for that which i entered . could any one give me the query to retrieve all the given parameter name and value accordingly by request id.
Thanks,
JP.
June 16th, 2009 at 3:18 am
How to send the status as WARNING for a HOST concurrent program.
June 18th, 2009 at 1:29 pm
Make sure to load the script onto the server in ASCII mode and not in Binary mode. Our concurrent program could not find the script until we reloaded the script in ASCII.
July 16th, 2009 at 3:04 pm
Thx a lot :)
October 9th, 2009 at 2:18 am
Hi Sachin Goel,
Here is the way how to set WARNING for a HOST concurrent program.
In UNIX, you have only 2 status i.e; True or False.
If you use exit 1 you can see Completed Error stauts for Concurrent request.
To Set other status follow this:
MYOWNSTATUS=`sqlplus -s $1 <<!
SET HEADING FEEDBACK OFF PAGESIZE 0
declare
l_result boolean;
l_session_id number;
begin
fnd_global.INITIALIZE(l_session_id, null, null, null,null, -1, null, null, null, null, $4, null,null,null,null,null,null,-1);
l_result := fnd_concurrent.set_completion_status(‘WARNING’,’Review log file for details.’);
commit;
end;
/
exit;
!`
Include the above code in your script. This will work
Note: $1 is Username/Password and $4 is FCP_REQID (Request id).
Do let me know if you need any more info.
December 23rd, 2009 at 7:40 pm
[…] 7. Go to system admin,complete the steps as mention in this post. […]
June 21st, 2010 at 7:36 am
How to send the status as warning for a Host concurrent program.
October 7th, 2010 at 11:44 am
hi Snajit,
I have a req- like I have a SQL query which returns like – 700 records – now – this SQL script need to be scheduled – to run everymonth 15th.
Req: When we run this SQL through Concurent request – the out of this SQL script sud be placed in one of the FTP server location in XLS format
Qsn: – how do I start for this req – like after I read ur tthread I learned – that I have to register as a Host program – but how abt that SQL whcich returns – values ??
plz shed some light on this to start..
my email – rameshkumar.pujari@gmail.com
thax in adv