Solved

Does anyone know how to kick-off a Cobol program residing on a Unix box from a Windows App written in VB or VB.NET?

Posted on 2003-12-10
6
304 Views
Last Modified: 2008-01-09
I need to kick off a file-based Lawson ERP interface program on a Unix server from a microsoft VB/COM or .NET client.  

My client has a pre-determined file layout for a specific type of  inventory transaction.  After I create a file in my VB program for this transaction and FTP it to a specified directory on the Unix box, I need to kick off a COBOL program on the Unix box.  The COBOL program will pick up my file, read it, apply numerous business rules, calculations, and database updates.

How do I remotely kick-off a Unix program from a windows environment?



0
Comment
Question by:vjcapron
6 Comments
 
LVL 9

Expert Comment

by:Dang123
Comment Utility
vjcapron,
    Here are some ideas.

1) http://www.vb-helper.com/tutorial_screen_scraping.html
    Use this method to go through the motions of logging on with the necessary id and submitting the program.

2) Create a job on the Unix box that runs continuously. It should look for a file with a specific name placed in a specific directory. If it finds the file, it should open it and execute the commands inside (logging the action), then delete the file and start looking for it again. You VB program then needs to simply upload the instruction file as a fine step.

3) MVS has the following FTP commands to submit jobs into the execution queue
        literal site file=jes
        put job.jcl
Check local help or the documentation for your Unix FTP to see if something similar exists for you.

Hope one of the ideas helps

Dang123

0
 
LVL 1

Expert Comment

by:RichNH
Comment Utility
I'm not familiar with UNIX but I agree that the most probable solution is one where the unix box has a process running continously (usually some sort of batch/script job that has a wait statement in it or is on a scheduler and runs every few minutes).  The batch job would check for the presence of the file and if found would start the COBOL job.  If one cannot check for a file's existance in script in Unix (I would think that you could) then it's easy enough to simply code the COBOL program to check if the file is present or not when you try to open it (look at the status return code for the open) and if its not present then end the program.  Obviously if it is present you process the file.

RichNH
0
 

Author Comment

by:vjcapron
Comment Utility
The most appropriate answer to the question "How do I remotely kick-off a Unix program from a windows environment?" is executing a remote shell command from a .NET application.

The .NET framework provides an object for this purpose, which makes it a very clean solution.  Below is a code snippet:

Const RSH_Host As String = "10.2.2.1"  'NameOfUnixBox_Or_IPAddress
Const RSH_Path As String = "/users/law/prod/drsrc/net.sh"  'path to program
Const RSH_User As String = "UserName"  'UserID with appropriate permissions
Const RSH_PW As String = "Password"  

Dim RunRSH As New WinRSH32Runner.Execute()
RunRSH.Go(RSH_Host, RSH_Path, RSH_User, RSH_PW, False)
0
 

Accepted Solution

by:
modulo earned 0 total points
Comment Utility
PAQed, with points refunded (250)

modulo
Community Support Moderator
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

RIA (Rich Internet Application) tools are interactive internet applications which have many of the characteristics of desktop applications. The RIA tools typically deliver output either by the way of a site-specific browser or via browser plug-in. T…
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now