- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- function in cobol for execute s.o. commands
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-01-2009 12:23 PM
тАО09-01-2009 12:23 PM
I have a I64VMS COBOL V2.8-1380 under ovms 8.3 1h1
my question is
some one knows any function or lexical o utility that let to me execute a vms command inside of my cobol program (dir,@,show etc)?
regards
Solved! Go to Solution.
- Tags:
- COBOL
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-01-2009 12:39 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-01-2009 12:52 PM
тАО09-01-2009 12:52 PM
Re: function in cobol for execute s.o. commands
However, while you phrase the problem very generically, I wonder whether you have a specific problem in mind.
I ask this because many OpenVMS task have a calleable interface, which typically allows much more control for perhaps a little bit more coding work.
Specifically you may want to use LIB$FIND_FILE or SYS$PARSE + SYS$SEARCH to find files like 'dir', and SYS$GETJPI (or LIB$GETJPI) to do SHOW PROCESS style work.
For a commadn file (@) you would need LIB$SPAWN or perhaps start it as a batch job? ( SYS$SNDJBC )
So what problem are you really trying to solve?
My last customer to ask the question how to call @ from Cobol actually wanted to run a command file which they always used to clear the screen... Cobol has that build in!
hth,
Hein
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-01-2009 01:34 PM
тАО09-01-2009 01:34 PM
Re: function in cobol for execute s.o. commands
$copy/ftp/anon arch.dat 10.x.x.x::comdet'dato1''dato2''dato3'.pf8
regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-01-2009 01:55 PM
тАО09-01-2009 01:55 PM
Re: function in cobol for execute s.o. commands
Use the cobol 'STRING' verb to glue together a commandline (pieces DELIMITED BY SIZE (or 'delimiter), passing that by descriptor.
Or use SYS$FAO to cobble together a string from multiple pieces.
It's kinda lame there is no calleable FTP, but there isn't.
Perl has a module implementing am FTP client, but that does not help you much.
Hein.
$perl -e "use Net::FTP; $x=Net::FTP->new (q(10.x.x.x)); $x->login(q(user),q(pass)); $x->get(q(tmp.tmp))"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-01-2009 01:59 PM
тАО09-01-2009 01:59 PM
Re: function in cobol for execute s.o. commands
Unfortunately COPY doesn't have a callable interface. For a normal copy, you can get by with callable convert CONV$CONVERT, but that won't help you with COPY/FTP.
I'm not aware of any callable interface for FTP, other than talking the protocol yourself using sockets. So, you're really left with SPAWN. In its simplest form in COBOL it would look something like:
CALL "LIB$SPAWN" USING BY DESCRIPTOR "copy/ftp/anon arch.dat 10.x.x.x::comdet'dato1''dato2''dato3'.pf8"
GIVING SpawnStatus
of course, you can build up the string in a variable and pass it, but be careful to make sure the descriptor gets the correct length.
Any output, including error messages would go to SYS$OUTPUT. See the LIB RTL manual for details of the (many) other arguments.
Also note that this will only work from a process with a CLI (includes interactive, batch and network processes, but not all detached processes).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-01-2009 10:40 PM
тАО09-01-2009 10:40 PM
Re: function in cobol for execute s.o. commands
http://nbpfaus.net/~pfau/ftplib/
is a callable FTP interface.
Never used it myself, but looks promising.
BTW: the "/anonym" option is not available for all VMS FTP clients.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-08-2009 01:26 PM
тАО09-08-2009 01:26 PM
Re: function in cobol for execute s.o. commands
now used another external aplication for transfer.
cheers