Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / April 2006

Tip: Looking for answers? Try searching our database.

Problem using cobol with java

Thread view: 
awosy - 28 Apr 2006 12:22 GMT
Hey

I need to pass parameter to a cobol program with I start from a java program.
I was able to run an cobol program that doesn't use parameters already but i'm stuck now

this is my java code i use to run a cobol program that doesn't need parameters

public class TestRunCobol
{
    private static ShowText txtProg;
   
    public static void main(String[] args)
    {
        txtProg = new ShowText();
        txtProg.run();
    }
}

And this is the cobol program to which i want to pass 1 parameter (String value)

IDENTIFICATION DIVISION.
PROGRAM-ID. ShowText.
ENVIRONMENT DIVISION.
DATA DIVISION.
      WORKING-STORAGE SECTION.
              01 break pic x.
      LINKAGE SECTION.
             01 param1 object reference "java.lang.String".
PROCEDURE DIVISION USING by value param1.
Main.
      Display "Parameter passed: " param1
      accept break from console
      Stop run.

can somebody tell me what i have to do in my java code to pass the String value?
Thomas Weidenfeller - 28 Apr 2006 13:32 GMT
> I need to pass parameter to a cobol program with I start from a java program.
> I was able to run an cobol program that doesn't use parameters already but i'm stuck now
[quoted text clipped - 4 lines]
> {
>     private static ShowText txtProg;

I have no intention to mind read what ShowText is. So, read
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Runtime.html#exec(java.lang.String[])

/Thomas
Signature

The comp.lang.java.gui FAQ:
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq
http://www.uni-giessen.de/faq/archiv/computer-lang.java.gui.faq/



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.