- 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-12-2008 06:01 AM
тАО09-12-2008 06:01 AM
VMS - How to pass parameters to to an executable through DCL script
I have got one executable(i.e. run mc$img:xx.exe)which asks few parameter values during the execution. Now I want to automate the entire thing through a DCL script to run in a batch job every hour.
Please suggest.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-12-2008 06:41 AM
тАО09-12-2008 06:41 AM
Re: VMS - How to pass parameters to to an executable through DCL script
Your script shoud begin with
$! get the name of the proc file
$ self = F$PARSE(";",F$ENVIRONMENT("PROCEDURE"))
$ subm/after="+01:00:00" 'self /que=xxx...
$ ! then run your .exe and pass the parameters
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-12-2008 06:43 AM
тАО09-12-2008 06:43 AM
Re: VMS - How to pass parameters to to an executable through DCL script
I mean, how to pass the parameteres to the executable inside a dcl script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-12-2008 06:45 AM
тАО09-12-2008 06:45 AM
Re: VMS - How to pass parameters to to an executable through DCL script
that depends on HOW the exe expects he params!
But an educated guess:
_IF_ the exe reads from standard input (SYS$INPUT), then
(beware of line wrapping!)
.
.
$ define/user SYS$INPUT SYS$COMMAND ! equate the command stream to the inputdevice for the duration of ONE image
$ run mc$img:xx
1st param
2nd param
3rd param
.
.
$ ! (any line starting with $ ends inout, and is the next DCL command)
be aware that _NO_ value substitution is done during parameter reading! If that is needed, a temporary COM file needs to be generated & @-ed.
-- Or the image must be able to take in parameters from the command line, in which case more info about the source of it is needed.
hth
Proost.
Have one on me.
jpe
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-12-2008 06:50 AM
тАО09-12-2008 06:50 AM
Re: VMS - How to pass parameters to to an executable through DCL script
one more thing.
To get the parameters INTO the batch job, add
/PARAMS=(1st,[2nd],[3rd,[...]]]]
to the SUBMIT command.
And if you use the param-per-line mechanism I gave before, you DEFINITELY need the temporary COM file mechanism!
Proost.
Have one on me.
jpe
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-12-2008 07:54 AM
тАО09-12-2008 07:54 AM
Re: VMS - How to pass parameters to to an executable through DCL script
>$ define/user SYS$INPUT SYS$COMMAND ! equate the command stream to the inputdevice for the duration of ONE image
>$ run mc$img:xx
>1st param
>2nd param
>3rd param
Hassan,
Jan mis-spoke. Do NOT use:
$ define/user SYS$INPUT SYS$COMMAND
in a batch file. If the program is reading input from standard input (SYS$INPUT on VMS) just use the lines that come after it.
Basically lines that begin with a $ character are interpreted by DCL, but if a program is run than any lines after the $ line that runs the program (not counting a - continuation line) are passed as input to the program. The next line that begins with a $ ends the program input (if the program tries to read more lines it gets end-of-file).
It's also possible that your program will parse its parameters from a command line. If so to use a command line you can do:
$ MCR mc$img:xx.exe param1 param2 param3
which works the same interactively or in a batch job.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-12-2008 08:09 AM
тАО09-12-2008 08:09 AM
Re: VMS - How to pass parameters to to an executable through DCL script
Download
http://h71000.www7.hp.com/doc/731FINAL/DOCUMENTATION/PDF/OVMS_731_USERS.PDF
and at least skim chapters 13-16.
If you do programming in a compiled language, you should also grab the programming concepts documenttion:
http://h71000.www7.hp.com/doc/82FINAL/5841/aa-rnshd-te.PDF
http://h71000.www7.hp.com/doc/82final/5841/aa-pv67h-tk.PDF
If you are responsible for the system, you should know what is in the system manager's essentials:
ftp://ftp.hp.com/pub/openvms/doc/AA-PV5MJ-TK.PDF
and have the second volume on hand for reference.
http://h71000.www7.hp.com/doc/82FINAL/aa-pv5nj-tk/aa-pv5nj-tk.PDF
++++++++++++++++++++++
If you want more focused answers, please show us an example of what types of parameters the xx.exe is asking.
Normally, I think of parameters as something that is passed to the program without being prompted. For example the name of a user you want to see info about
$ show user system
That is relatively easy to do in a command procedure.
$! myshowuser.com
$! wrapper for show user
$! p1 parameter for user
$ show user 'p1' ! this substitues the first param passed to myshowuser.com
$ exit
This example is not very useful, since it adds no functionality, but it is just to demonstate a point.
Now the two following commands will do the
same thing:
$ @myshowuser system
$ show user system
However, you suggest that you really are referring to something the program is prompting the user for.
As Jan van den Ende stated, you can create an "answer file" that will be used as answers to the prompts the program generates.
However, be aware that it the questions can change based on the previous answers given, then that method will not work in the general case. It is essentially like running the program and then typing in all the answers into the typeahead buffer.
An example of what won't work: Suppose xx.exe asks for a quantity, and someone enters "j45". If the program was written with the expectation that there was a person entering the data, the appropriate action is to tell the user that "j45" isn't an acceptable answer for a quantity, and to reprompt the user for the correct answer.
If you are running from batch, you will need to make sure what is provided in the answer file is valid so that will not occur.
A harder problem is a program that asks different questions based on previous answers. If you can't predict the questions, you can't predict the correct response.
Is the mc$img:xx.exe a program written by someone in your company that you have the source code for? If so the program can be written in a way that it will accept command line parameters, which in general are much easier to deal with from DCL.
Jon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-12-2008 10:09 AM
тАО09-12-2008 10:09 AM
Re: VMS - How to pass parameters to to an executable through DCL script
>>>
Jan mis-spoke. Do NOT use:
$ define/user SYS$INPUT SYS$COMMAND
in a batch file.
<<<
Jeah.
My first answer was perhaps written a little bit too hastily. I SAW the "automate", but overlooked the "in a batch job".
That definition applies when input is expected from the input stream, but is to be redirected to be taken from the highest level control device (which interactively is the terminal, and in batch is the primary command file)
So sorry, it will not happen again (until next time)
Proost.
Have one on me.
jpe
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-12-2008 01:54 PM
тАО09-12-2008 01:54 PM
Re: VMS - How to pass parameters to to an executable through DCL script
$ open/write temp temp.com
$ write temp "$ RUN myProgram"
$ write temp "param_1_value"
$ write temp "param_n_value"
$ close temp
$ @temp
$ delete temp.com;
/Guenther
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-12-2008 02:36 PM
тАО09-12-2008 02:36 PM
Re: VMS - How to pass parameters to to an executable through DCL script
Also on offer: lib$get_foreign, and creating your own CLD file / DCL verbs.
Cheers Richard Maher