- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Re: VMS - How to pass parameters to to an executab...
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
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-14-2008 10:35 PM
тАО09-14-2008 10:35 PM
Re: VMS - How to pass parameters to to an executable through DCL script
$ xx :== run mc$img:xx.exe
$ xx p1 p2 p3
When the parameters are derived from some system data or parameters passed to the procedure, these will be substituted provided you used the right syntax:
$ xx 'p1' 'p2' 'p3'
(if neither of these contain spaces, or lower case text that needs to be preserved lowercase. Otherwise encluse such a parameter in double quotes like this:
$ xx "''p1'" 'p2' 'p3'
if p1 is such a parameter)
OpenVMS Developer & System Manager
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-14-2008 11:25 PM
тАО09-14-2008 11:25 PM
Re: VMS - How to pass parameters to to an executable through DCL script
>>>
$ xx :== run mc$img:xx.exe
$ xx p1 p2 p3
<<<
That will NOT work!
You will have to invoke MCR for this
$ xx :== MCR mc$img:xx
(or, the alternate syntax for the same)
$ xx :== $mc$img:xx
But mind, for this to function the xx source code must have command line handling, in a way that Richard Maher describes.
Which may well be the case, so it IS worth the try!
hth
Proost.
Have one on me.
jpe
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-15-2008 08:34 PM
тАО09-15-2008 08:34 PM
Re: VMS - How to pass parameters to to an executable through DCL script
1. in dcl create a named file in the native directory of the executable.
2. write the parameters to the named file, may be a nn.txt or nn.dat file.
this could be thru a script, which asks for the parametrs using "dcl == inquire statement"
3. in the excutable read the named file nn.dat as the input parameter source, (include some parameter validation)
4. when the executable exits, ensure tht u delete the nn.dat file., else u will create
m versions of the file created for each run.
if u can give more details about the way ur executable ingests the params, it would help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-15-2008 09:13 PM
тАО09-15-2008 09:13 PM
Re: VMS - How to pass parameters to to an executable through DCL script
I don't see any significant advantage to this over the creation of a temporary command file as has already been suggested.
Another issue is that as described, it seems that the executable will be looking for a fixed file name to be created in the directory that the executable exists in? Fixed file names cause problems with concurrent use. It would be better to just use a name like "PARAM_FILE" and have the command file define param_file with the file specification of the specific instance. And I would definitely not put the parameter file in a shared directory with world write access.
If you are going to modify the program, use lib$get_foreign, the CLI$ routines or if written in c, the argc, argv constructs to allow the parameters to be passed on the command line. This has many advantages over temporary files. It makes it much easier to pass information in, since DCL symbol substitution will work, you don't have to worry about temporary file name collision (so concurrency is no problem), file cleanup, protection, etc. etc.
And use "read/prompt" instead of "inquire" when prompting for input from DCL. In my opinion, the DCL INQUIRE command should never be used.
Jon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-15-2008 10:02 PM
тАО09-15-2008 10:02 PM
Re: VMS - How to pass parameters to to an executable through DCL script
But sometime feeding new commands in a pipe is a nice way to go, using SPAWN perhaps.
Or PERL.
Here is a silly example
------------ test.pl ----------
@disks = reverse sort grep /:/, qx(show device dk); # Just a silly way to get lines with devices
$cmd = "dfu"; # just an example
open CMD,"|$cmd" or die "Could not open pipe into $cmd\n$!";
for (@disks) {
$disk = (split)[0]; # grab the disk name from the line
print CMD "report $disk\n"; # feed into command.
sleep 5; # wait a while.
}
--------------------------
So the example just picks one line from a list of devices and feeds it into a DFU program once every 5 second.
But it could just as easily feed multiple lines, dynamically created from file or directory contents in a reporting tools every hour.
Of course such approach would keep a process alive, waiting for input.
A self-re-sumbitting batch job uses no resources while waiting.
Both methods have their uses.
Cheers,
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-18-2008 03:02 AM
тАО09-18-2008 03:02 AM
Re: VMS - How to pass parameters to to an executable through DCL script
Thanks for your help.
- « Previous
-
- 1
- 2
- Next »