- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Use a symbol in a DCL command procedure
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
Forums
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
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
тАО10-25-2004 01:51 AM
тАО10-25-2004 01:51 AM
Example:
$date=f$time()
$monitor
monitor io/sum='date'.sum
This does NOT work as the symbol in this case is not being interpreted by DCL before being passed to the monitor command.
Is there a way, nevertheless, to accomplish this?
Chaim
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-25-2004 02:18 AM
тАО10-25-2004 02:18 AM
Re: Use a symbol in a DCL command procedure
on line line.
$ MONITOR IO/SUM='date'.SUM
Generally no as what is imput in response to the program promp (MONITOR> in this case) is not seen by DCL so can't have symbol subtitution. The classic workaround is to write a temp DCL procedure with the right commands in then execute it and delete it after.
Purely Personal Opinion
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-25-2004 02:26 AM
тАО10-25-2004 02:26 AM
SolutionNowadays a very nice option is the PIPE command, using input redirection!
Your example
(including a conversion from date-time to date)
$ PIPE MONITOR < MONITOR IO/SUMM='f$cvtim("","comparison","date")'.sum
Cheers.
Have one on me.
Jan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-25-2004 02:36 AM
тАО10-25-2004 02:36 AM
Re: Use a symbol in a DCL command procedure
nice solution for single line input (worthly of a virtual Duvel Triple :-) but that would not work for multiple line input. I guess (as usual) it depends on what Chaim is really trying to do.
Purely Personal Opinion
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-25-2004 03:14 AM
тАО10-25-2004 03:14 AM
Re: Use a symbol in a DCL command procedure
To classic solution for this is to create a temp file, write the datalines to it, close, give to the program as sys$input, delete.
Most variations are in the file name and place (sys$login vs current vs sys$scratch / temp.tmp vs process-name-input.tmp vs PID.tmp
Nowadays you should consider a pipe, as answerred before.
There are also some MAILBOX solutions around.
Use tool to create a mailbox, open, write...
Cheers,
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-25-2004 03:49 AM
тАО10-25-2004 03:49 AM
Re: Use a symbol in a DCL command procedure
I'm sorry but I'm not convinced that yours example works properly. By the PIPE definition < is the SYS$INPUT redefinition from an input file. I dont know why yours example works. It seems that the < MONITOR part is not executed so you at end have the same command as Ian. You can try by typing:
$ PIPE MONITOR < EATEN IO/SUMM='f$cvtim("","comparison","date")'.sum
You can substutute EATEN with any other word and the results are the same.
You can use pipe with a temporary file, where you write your data as suggested by Ian and use as:
$ PIPE MONITOR < yours_file
The second way is to write a procedure which will write the the data to SYS$OUTPUT and use as this:
$ PIPE @yours_procedure | MONITOR
The contents of yours_procedure are something like this:
$ WRITE SYS$OUTPUT "MONITOR IO/SUMM=''f$cvtim("","comparison","date")'.sum"
Bojan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-25-2004 09:38 AM
тАО10-25-2004 09:38 AM
Re: Use a symbol in a DCL command procedure
For clarity, I've defined:
$ in = "write sys$output"
So, the monitor case becomes:
$ date=f$time()-" " ! remove space
$ pipe in "monitor io/sub=''date'.sum" | monitor
For multiple lines of input, use ";" to separate commands (make sure you have a space on either side), and group lines with parentheses (). For example, assuming the symbol "pid" is set to the PID of a process of interest:
$ pipe (in "set process/index=''pid'" ; -
in "show process/channel" ; -
in "show process/lock") | -
analyze/system
The only limit is command line length.
If you do use temporary files, remember you now (V7.3-2 and higher) have F$UNIQUE() to generate names:
$ tmp="SYS$SCRATCH:"+F$UNIQUE()+".tmp;"
$ OPEN/WRITE tmp 'tmp'
$ WRITE tmp "monitor io/sum=''date'.sum"
$ CLOSE tmp
$ DEFINE/USER SYS$INPUT 'tmp'
$ MONITOR
$ DELETE 'tmp'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-25-2004 05:52 PM
тАО10-25-2004 05:52 PM
Re: Use a symbol in a DCL command procedure
That IS what I meant, only, I am only just beginning with using it, and not yet totally familiar :-(
Bojan:
I simply tried what I thought looked like it,
it worked, so I posted, without really investigating more telltale variaties.
I m so sorry, won t happen again (until next time).
Cheers.
Have one on me.
Jan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-25-2004 07:44 PM
тАО10-25-2004 07:44 PM
Re: Use a symbol in a DCL command procedure
follow example works for me :-)
$ SAY="$WRITE SYS$OUTPUT" !Alias to echo
$ PIPE SAY "monit io /sum=''f$extr(0,10,f$cvtime())'.sum" | MONIT
Antonio Vigliotti
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-25-2004 08:28 PM
тАО10-25-2004 08:28 PM
Re: Use a symbol in a DCL command procedure
Now what is needed is for Chaim to come back and explain what he is trying to do.
Purely Personal Opinion
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-26-2004 12:22 AM
тАО10-26-2004 12:22 AM
Re: Use a symbol in a DCL command procedure
$date=F$EXTRACT(0,9,F$TIME())
$define/user sum_file 'date'.sum
$monitor
monitor io/sum=sum_file/ending=18:00/int=30
$exit
I understand that this particular example doesn't really require invoking monitor and then issuing a monitor command and that I could issue the entire command as a DCL line command. However, I am looking for a way to be able to dynamically use a symbol or as I have discovered a logical for dynamic usage.
Thanks for all the replies!!
Chaim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-26-2004 12:53 AM
тАО10-26-2004 12:53 AM
Re: Use a symbol in a DCL command procedure
"... However, I am looking for a way to be able to dynamically use a symbol ..."
As I understand this, your question is about a generic way to use to contents of a symbol to be used in the input for an image.
Then, yes, in the case where you want to use your symbol value in a (any) filename, then you can do a define logical name for that file.
The logical name definition is done in a "normal" DCL command line, ie, with normal symbol substitution.
Then, in your image data line, you use a fixed file name (that is to say, as far as DCL is concerned). So, no substitution needed. At a certain moment when your image needs the file, then RMS parses the filename to get to the file ID. And RMS knows how to handle Logical Names (without THAT, most of VMS flexibility & reliability would not exist!!).
So, as long as it is about building 'variable' filenames, DEFINE works.
For all other kinds of variable data input, you are still down to either of the above methods: the classicle "write file / execute it / delete it", or the recently available PIPE manipulations.
HTH
Cheers.
Have one on me.
Jan