Calling an external cobol program
I have a web page that passes and retrieves a data string to an activeX object that in turn calls a cobol program that does all the work. Is it possible to do this with Application Express?
Message was edited by:
user511722
I don't know much about COBOL, but if you can fire the COBOL program from the command line of the ApEx host, you can also use DBMS_SCHEDULER with the EXECUTABLE option.
Search the PL/SQL forum with the above uppercase keywords for examples of how to write the procedure call.
I'm assuming you are using 10G.
Similar Messages
-
Calling an (External) Java Program
I know how to call methods from external classes, but how do I launch a self-contained program from one of my applets?
DLHave tried searching, but it takes a long time on this
connection - the best DialUp speed I can get is 28.8
and most of the time is 14.4.Well, you managed to download the SDK so why not the documentation? It must be hard to work without it.
To start an external application try one of the exec methods of java.util.Runtime. -
CPIC error when calling a external c program
Hi All,
i Have a scenario where we call a C-Program(RFC api) to connect to and external system thru tcp/ip.
The issue here is when we call the c program from ABAP we get the below error in files
dev_rfc0
Trace file opened at 20091222 094649 TAIST, REL 46D,0,2464, VER 3
======> CPIC-CALL: 'ThSAPCMRCV' : cmRc=20 thRc=223
CPIC program connection ended (read error)
Error RFCIO_ERROR_SYSERROR in abrfcpic.c : 2961
CPIC-CALL: 'ThSAPCMRCV' : cmRc=20 thRc=223
CPIC program connection ended (read error)
dev_w0
Tue Dec 22 09:46:49 2009
***LOG R49=> tskh_receive, CPIC-Error (020223) [thxxhead.c 6003]
***LOG R5A=> tskh_receive, CPIC-Error (80600115) [thxxhead.c 6008]
***LOG R64=> tskh_receive, CPIC-Error ( CMSEND(SAP)) [thxxhead.c 6013]
RFC 2959 CONVID 80600115
CMRC=20 DATA=1 STATUS=1 SAPRC=223 ThSAPCMRCV
RFC> ABAP Programm: ABAPXXXX (Transaction: SE38)
RFC> User: abc (Client: 300)
RFC> Destination: APIRFC (handle: 1, convid , {4B2E49E2-A088-0082-E100-80003517BA61})
RFC> Called function module: RFC_API
dev_rd
Tue Dec 22 09:46:49 2009
***LOG S23=> GwDisconnectClient, client disconnected (029) [gwxxrd.c 10609]
***LOG S74=> GwDisconnectClient, client disconnected ( ijkl211) [gwxxrd.c 10620]
***LOG S0R=> GwDisconnectClient, client disconnected () [gwxxrd.c 10636]
***LOG S0I=> GwDisconnectClient, client disconnected ( interfac) [gwxxrd.c 10657]
In sm21
R49 Communication error, CPIC return code 020, SAP return code 223
Can any one help me find wat might be the cause of this issue.We are using SAP R/3 and OS is AIX 5.3
Thanks,RajeshDear Rajesh,
This depends on what your program does. Based on the error message, it looks like the program ends abnormally, as the gateway writes an error while attempting to read/write data from the connection to the program. With what you have given, the error does not seem to lie with the SAP side. You will have to check your program, e.g. using a debugger.
Best Regards,
Tim -
Issue while calling COBOL program from Component Interface in PeopleSoft HRMS 9.2
In HRMS 9.2, I am facing problem while calling the remote call function through component interface. In GP_ABS_EESS_REQ (Navigation Main Menu > Self Service > Time Reporting > Report Time > Absence Request) component, we have “Forecast Balance” button as shown below:
This button checks for eligibility for leave being applied. While using component interface, it executes FORCAST_PB field change event peoplecode which contains a remote call to a cobol program as below:
RemoteCall("PSRCCBL", "PSCOBOLPROG", "GPPOLRUN", "NET_RETURN_CD", &NET_RETURN_CD, "NET_TXN_ID", &NET_TXN_ID, "NET_TXN_NUM", &NET_TXN_NUM, "NET_MSG_ID", &NET_MSG_ID, "NET_MSG_PRM_CNT", &NET_MSG_PRM_CNT, "NET_MSG_PRM1", &NET_MSG_PRM1, "NET_MSG_PRM2", &NET_MSG_PRM2, "NET_MSG_PRM3", &NET_MSG_PRM3);
I am getting following error while executing it via component interface:
(2,148) - Think-time PeopleCode event (RemoteCall), but a SQL update has occurred in the commit interval. (2,148) FUNCLIB_GP_ABS.FCST_PB.FieldFormula Name:Abs_ForecastExec PCPC:5311 Statement:60
Called from:GP_ABS_EESS_REQ.GBL.DERIVED_ABS_SS.FCST_PB.FieldChange Statement:26
(91,34) - Error changing value. {Z_GP_ABS_EESS_REQ_CI.FCST_PB} (91,34)
(18,2) - Data being added conflicts with existing data. (18,2)
(91,37) - Error saving Component Interface. {Z_GP_ABS_EESS_REQ_CI} (91,37)
After commenting out this line of code, I was able to save the CI successfully. But I need to execute this statement before saving CI so that I can check the eligibility for leave being applied. Can anyone help me on this issue?When I tried to read the file using `CAT -vt <filename>`, I could see that the file contains special characters such as ^M and ^I. This may be because of the file transfer mode(but I transferred in ASCII mode, still the special characters where appearing).
I opened a VI editor and pasted the same script. Save the file, tried to run the script, It was working fine.
I still didn't get how the special characters appeared. I used notepad++ as my editor. -
Execute an external java program with Runtime, problem with classpath
Hi,
I m calling an external java program by the command:
Runtime.getRuntime().exec("java -classpath \"library/*\" org.mypackage.TestMainProgram param1 c:/input/files c:/output/files");All my classes are stored in the relative directory "library", and it contains ONLY .jar files. However, I keep getting errors like:
"java.lang.NoClassDefFoundError: library/antlr/jarCaused by: java.lang.ClassNotFoundException: library.antlr.jar at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)Could not find the main class: library/antlr.jar. Program will exit.Exception in thread "main" where "antlr.jar" is a jar file in "library". It is there but still the program keeps complaining it cannot be found. The problem applies to any jars in "library", ie.., if i have "mylib.jar" then it will complain "NoClassDefFoundError: library/mylib/jar".
Could anyone give some pointers please?
Many thanks!
Edited by: 836590 on 14-Feb-2011 09:03836590 wrote:
Hi,
I m calling an external java program by the command:
Runtime.getRuntime().exec("java -classpath \"library/*\" org.mypackage.TestMainProgram param1 c:/input/files c:/output/files");All my classes are stored in the relative directory "library", and it contains ONLY .jar files. However, I keep getting errors like:
"java.lang.NoClassDefFoundError: library/antlr/jarCaused by: java.lang.ClassNotFoundException: library.antlr.jar at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)Could not find the main class: library/antlr.jar. Program will exit.Exception in thread "main" where "antlr.jar" is a jar file in "library". It is there but still the program keeps complaining it cannot be found. The problem applies to any jars in "library", ie.., if i have "mylib.jar" then it will complain "NoClassDefFoundError: library/mylib/jar".
Could anyone give some pointers please?
Many thanks!
Edited by: 836590 on 14-Feb-2011 09:03First, if you run from the command line
java -classpath "library/*" org.mypackage.TestMainProgram param1 c:/input/files c:/output/filesfrom the parent directory of library, does it work?
Despite what I said to Kayaman about Runtime.exec not expanding the asterisk, it looks like that's what's happening, so that you're getting
java -claspath library/aaaa_something_before_antlr.jar library/antlr.jar library/bbb.jar library/ccc.jar org.mypackage.TestMainProgram param1 c:/input/files c:/output/filesThat is, it *is* expanding the asterisk to a list of files in the directory, and the first one is being taken as the classpath, and the second one--library/antlr.jar is being taken as the class to execute. I'm certain this doesn't happen on Linux, so it must be a Windows thing.
Two suggestions:
1) Try single quotes instead of double.
2) Try the exec that takes an array
Runtime.getRuntime().exec(new String[] {"java", "-classpath", "'library/*'", "org.mypackage.TestMainProgram", "param1", "c:/input/files", "c:/output/files");Edited by: jverd on Feb 14, 2011 9:41 AM -
External procedure call for cobol programs
I'm trying to call cobol programs using external procedure calls. I followed metalink doc#119543.1 but when the cobol shared library is called from PL/SQL, the session hangs. I'm running Oracle 9.2.0.4 EE, Microfocus Server Express 2.2, C for AIX v6, and AIX 5.2 (64-bit). If you know how to get this working or you have a working test case, please post a reply. Thanks.
You know that there are several steps to it :
1.- Make a library from cobol a the source code in a file
2.- Check the listener parameters to call external procedures and the service in the client
3.- Make a library inside the database
4.- Create the procedure that is going to call the
procedure.
Did you do those steps?
Joel P�rez -
Calling Cobol program from PL/SQL
What is the caling convention for PL/SQL to call a Cobol program?
You cannot do it directly from PL/SQL. PL/SQL is.. well, kind of abstract ito the actual platform it runs on. PL/SQL cannot talk directly to operating system. It cannot (itself) do socket calls, file I/O calls, use the printer, etc.
<p>
All this has to be done using a lower level implementation library - like UTL_FILE for example that wraps internal C written modules that does file I/O. PL/SQL can call these to do I/O on its behalf. Ditto for wrappers like UTL_TCP and others.
<p>
There is no default wrapper for calling external processes from PL/SQL. It can however be done indirectly using the external procedure (EXTPROC) feature, or using Java to do it.
<p>
The latter is the easiest. You create a Java stored proc that can access the operating system and run external programs and commands. You punch a big hole in the Oracle Java security to allow this Java stored proc access to the operating system. Next you create a PL/SQL wrapper for this Java proc which then in turn can be called from PL/SQL.
Just remember that you MUST secure this hole you've punched into Oracle security. If any Oracle user can access this PL/SQL wrapper, they can hack, compromise, trash or simply destroy your entire Oracle account on that server.
Here is the basic code:
create or replace and compile Java Source named "OSCommand" as
-- java: OS COMMAND
-- descr: Executes an Operating System Command using the JAVA RTS
-- IN parameter: os command to execute (including fully qualified path names)
-- OUT parameter: returncode [\nstring]
-- where string a max of 32000 chars of the output of the command
-- (note that \n is used as separators in the string)
-- returncode=-1 Java RTS error occurred (e.g. command does not exist)
-- returncode=255 o/s command failed (e.g. invalid command params)
import java.io.*;
import java.lang.*;
public class OSCommand{
public static String Run(String Command){
Runtime rt = Runtime.getRuntime();
int rc = -1;
try{
Process p = rt.exec( Command );
int bufSize = 32000;
int len = 0;
byte buffer[] = new byte[bufSize];
String s = null;
BufferedInputStream bis = new BufferedInputStream( p.getInputStream(), bufSize );
len = bis.read( buffer, 0, bufSize );
rc = p.waitFor();
if ( len != -1 ){
s = new String( buffer, 0, len );
return( s );
return( rc+"" );
catch (Exception e){
e.printStackTrace();
return( "-1\ncommand[" + Command + "]\n" + e.getMessage() );
show errors
create or replace function OSexec( cCommand IN string ) return varchar2 is
-- function: OS EXEC
-- descr: PL/SQL wrapper for the Java OSCOMMAND stored proc
language JAVA
name 'OSCommand.Run(java.lang.String) return java.lang.String';
show errors
-- Punching a hole into the Java VM sandbox. The following must be run as
-- sysdba. Substitute SCOTT with the applicable schema that owns the OSEXEC
-- and OSCOMMAND stored procs.
declare
SCHEMA varchar2(30) := 'SCOTT';
begin
dbms_java.grant_permission(
SCHEMA,
'SYS:java.io.FilePermission',
'<<ALL FILES>>',
'execute'
dbms_java.grant_permission(
SCHEMA,
'SYS:java.lang.RuntimePermission',
'writeFileDescriptor',
dbms_java.grant_permission(
SCHEMA,
'SYS:java.lang.RuntimePermission',
'readFileDescriptor',
commit;
end;
-- example: running the Unix/Linux date command to get the current date and time
SQL> select OSexec('/usr/bin/date') as STDOUT from dual;
STDOUT
Fri Sep 1 08:09:34 SAST 2006
1 row selected.
SQL>Edited by: Billy Verreynne on Sep 4, 2008 6:26 PM to make the code snippet readable with the new Jive forum s/w. -
I'm running Labiew 6i for Linux. I'm using a system exec.vi to call an external program to do image manipulation (since there is no IMAQ for linux). How can I embed the user interface of the external program into the front panel of Labview?
As far as I know, the only way to embed other GUIs in LabView is an ActiveX in a container.
As long as you are using Linux, try to place (moving them on the desktop ) the two windows linked (like those 3 of WinAmp). -
How to call an external server from Webdynpro program?
Hi All,
i have a requirement in which i have to call an external server from Webdynpro ABAP program.
how to imphi ,
do u mean u need to call the external link from ur WD ABAP application ?
if so , u either create
1 a Link to URL ( LTU ) UI element and call the external link using that
2 if u wish to use some other fuctionality and thn wish to call the URL in ur application ,u write this piece of code in ur relevant on Action method :
data: lo_window_manager type ref to if_wd_window_manager.
data: lo_api_component type ref to if_wd_component.
data: lo_window type ref to if_wd_window.
data: ld_url type string.
lo_api_component = wd_comp_controller->wd_get_api( ).
lo_window_manager = lo_api_component->get_window_manager( ).
ld_url = ''. // ur external sever link here
CALL METHOD lo_window_manager->CREATE_EXTERNAL_WINDOW
EXPORTING URL = ld_url
RECEIVING WINDOW = lo_window.
lo_window->open( ).
I hope u wud be able to create URL now .
regards,
amit
Edited by: amit saini on Oct 13, 2009 11:25 AM -
Calling an external program (*.exe file) on the client
Hi,
I use 9iDS and I'd like to call an external program (*.exe file) on the client, but this exe file is located on the server not on the client.
So it should be something like a mixture between host and client_host(webutil) command. Is it possible to use client_host where a virtual path is passed to?
Regards SörenAre you saying you want to run on the exe on the client but its located on the server???
In that case you would have to do a webutil file transfer to move it to the client before executing. Or, if you are calling a DLL, webutil will download it automatically from the server to the client (see the C API example on the webutil page).
Regards
Grant Ronald
Forms Product Management -
How to call a external program in java?
Help!!
Is there any method that can a java program can call a external program? For example execute a exe file.
Thanks.Yes.
Runtime.getRuntime().exec("exactly what you would type at the command line");
But be aware that this is operating-system-specific and full of gotchas. When you run into one of them, come back to the forum and do a search, this is a frequent topic of discussion. -
Calling an external program!
Salut all, Im using unfortunately Oracle Forms 6i, and I need to call an external program that I have to develop in Java, compiled into .jar. I just wanna use something like java -jar myJar.jar <my params...> but I don´t know how to call external programs from Oracle Forms, in special from 6i.
I have searched this thread passed (Re: Calling JAVA from PL/SQL but didn´t help me so much.
Thanks all for patience!In version 9 and 10 we have a general way of calling out to java thru the Java Importer functionality.
If you cannot upgrade to these later versions and you don't need to get data back from the jar file execution you can always use the Host command to call it directly the way you have outlined. -
Before calling an external program, check if the program is allready open
I need to call an external program to print some labels, so i will use function WS_EXECUTE or the new one DSVAS_DOC_WS_EXECUTE_50 to call my program, but the problem that i have is:
when I call this function, the program open a small window, and if i have to call it again, it will open another window, and so on... obviously this is not a good solution.
Is there any one how knows how can i close the program, of perhaps it is enough if there is some way to know if the program is already open.
Many thanks in advance,
MiriamHi
you can use the ABAP Coverage Analyzer.
OR
This is a function module we use to limit the execution of a program to one instance at a time.
DATA: PRG LIKE INDX-SRTFD. PRG = SY-CPROG.
CALL FUNCTION 'ENQUEUE_ESINDX'
EXPORTING RELID = 'ZZ'
SRTFD = PRG
SRTF2 = 0
EXCEPTIONS FOREIGN_LOCK = 1
SYSTEM_FAILURE = 2.
IF SY-SUBRC NE 0.
FORMAT COLOR COL_NEGATIVE INVERSE ON.
WRITE: / 'ERROR: Program Is Already Running'.
WRITE: / 'Program', PRG, 'has been stopped. Rerun in 1 minute.'.
STOP.
ELSE.
WRITE: / 'OK ',PRG.
ENDIF.
Regards,
Raj -
Calling an external shell script program from ABAP.
Hi,
Can i call an external shell script program from abap which is there on application server.
The FM WS_EXECUTE i know can be used for calling this purpose.
But i am getting a doubt that how can i call the external program from there.
Please clear my doubts.
Thanks in advance.
Vikashsearch in SCN for sm49 and sm69 Tr. you will surely find solutions for it, with a simple search.
-
Call From Cobol Program on OS 390
Don Ferguson <[email protected]> writes:
What does IBM offer in this space? I guess its possible to envisage
calling an EJB from a COBOL program over IIOP, but no-one has tried
it. If this is how IBM does it then it should work with us also under 6.1
andy
Roman wrote:
Hi .
Try to WLS6 and WTC -- weblogic tuxedo connector and Elink 4 for connectivity
between OS390 CICS and Tuxedo.
IBM Websphere offers more as for EJB - OS390 system. But Weblogic is better
J2EE server (global view), in my opinion.
Roman
"Cameron Purdy" <[email protected]> wrote:
I'd suggest CORBA (2.3 or later).
Cameron Purdy
Tangosol, Inc.
http://www.tangosol.com
+1.617.623.5782
WebLogic Consulting Available
"Marc Lenart" <[email protected]> wrote in message
news:3a8956f2$[email protected]..
Can you steer me in the right direction as to how I can call a sessionbean from a
cobol program on the OS390 platform? An example wouyld be helpful.Thank
You!
Maybe you are looking for
-
Delete folder/file in Repository may be blocked by user
All, I am trying to delete a folder or file from the repository and I am unable to do this as maybe some user may have this file on his/her local workspace. when I try deleting this from the Repository tab, I get an error saying that a workspace has
-
Help needed with permissions problem in new Aperture 3.5.1
Hello and thank you for helping me with my first question to this wonderful support center. I have been using Aperture for many years. I recently upgraded my Mac to Mavericks, now running 10.9.2. and then upgraded (by necessity) to Aperture 3.5.1. I
-
How can I fix this?
-
COM+ and OLEDB - memory leak in OCI dlls
Hi forum, I've a COM+ DLL written in C++ which uses OLEDB(Oracle 8.1.7 provider) to reach to the 8i database. I've observed that after some 1000 database activities the DLLhost.exe hogs on memory to the tune of 50MB and never releases the same. I als
-
Big problem. U can complain with AT&T
I started the whole process according instructions, but somehow almost finishing it the phone started a loop for 15 hours now! It is not working. Someone suggested to complain with ATT&T to get a credit for no phone service. Message was edited by: cy