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
тАО03-09-2009 04:37 AM
тАО03-09-2009 04:37 AM
DCL
to an variable
I shall be thank full if you share some DCL scripting guide/book/document
thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-09-2009 05:00 AM
тАО03-09-2009 05:00 AM
Re: DCL
The simplest way to get the output of a command to a place where it can be read and analyzed is to use the ASSIGN/USER_MODE to route the logical name SYS$OUTPUT to a temporary file.
For an introduction to logical names, see "Logical Names (Part 1)", part of The OpenVMS Consultant series of columns on OpenVMS.org (see http://www.openvms.org/gezelter ).
The "DCL Dictionary" manual is available on the OpenVMS www site at http://h71000.www7.hp.com/doc/83final/9996/9996pro.html
- Bob Gezelter, http://wwws.rlgsc.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-09-2009 05:18 AM
тАО03-09-2009 05:18 AM
Re: DCL
In general, this doesn't work. Symbols are "bigger" on recent OpenVMS releases, but not big enough to contain the output from many DCL commands.
The OpenVMS User's Guide is the manual you want to read here. This is in the OpenVMS documentation set.
http://www.hp.com/go/openvms/doc
That material will help you understand symbols and logical names and how to deal with /OUTPUT qualifiers and command redirection and such.
The OpenVMS Frequently Asked Questions (FAQ) has how to pass command output around using the PIPE command and logical names. There's a copy of the FAQ here:
http://www.hoffmanlabs.com/vmsfaq/
There's another book around, _Writing Real Programs in DCL_ by Paul Anagnostopoulos and somebody named Hoffman, but that book is presently out of print and used copies of the second edition are reportedly expensive. It's now conceivable that this book might come back into print if there's enough demand, though not through the fine folks over at the Elsevier Digital Press imprint; the previous publishers.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-09-2009 05:25 AM
тАО03-09-2009 05:25 AM
Re: DCL
But most importantly you need to realize that often you do NOT need a command. DCL has a set of powerful LEXICAL to do what on other platforms (Unix) is done using a command.
For example, check out HELP LEXI F$SEARCH as a (better!) alternative to capture the DIRECTORY command output. Ans G$GETDVI and F$FILE and so on.... Check HELP and... RTFM!
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-10-2009 04:15 AM
тАО03-10-2009 04:15 AM
Re: DCL
$ dir/size=all/grand [...]*.*.*
Grand total of 38 directories, 697 files, 26981/71686 blocks.
Now lets say you want to assign the #of files and total blocks to symbols to use within a script. If P1 is the directory listing ("[...]*.*.*"), then the following command will define the symbols; NFiles = "number of files", and NBlks = Total Blocks.
$ Pipe Dir/Size=all/grand 'P1' | (Read Sys$Input Line ; Read Sys$Input Line ; -
Files = f$elem(5," ",Line) ; -
Blks = f$elem(1,"/",f$elem(7," ",Line)) ; -
define/job/NoLog Nfiles &files ;-
define/job/NoLog Nblks &blks)
$ Nfiles == F$TrnLnm("NFiles","Lnm$Job")
$ NBlks == F$TrnLnm("NBlks","Lnm$Job")
Its a bit clunky, but it is very flexible.
Dave.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-10-2009 04:42 AM
тАО03-10-2009 04:42 AM
Re: DCL
$ perl -e "for (qx(dir/size=all/grand *.*)){ if (/(\d+) fil.*\/(\d+)/) { $ENV{files}=$1; $ENV{blocks}=$2}}"
$ show log files, blocks
"FILES" = "514" (LNM$PROCESS_TABLE)
"BLOCKS" = "421728" (LNM$PROCESS_TABLE)
$
Same thing using those LEXICALS and a DCL loop:
-----------------------
$files == 0
$blocks == 0
$loop:
$ file = F$SEARCH ("*.*;*")
$ IF file .EQS. "" THEN EXIT
$ files == files + 1
$ blocks == blocks + F$FILE(file,"ALQ")
$ GOTO loop
--------------------------
$SHOW SYMBOL files ...
fwiw,
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-10-2009 11:39 AM
тАО03-10-2009 11:39 AM
Re: DCL
I agree. On UNIX, it often makes sense to
use the `` or $() notation in a script to
collect the output from some command. On VMS
it seldom does. DCL has lexical functions
which can be used in expressions, and these
are more often the better way to do things.
For example, on UNIX, one might try to parse
"df" output to find the free space on a file
system. On VMS, it makes little sense to try
the same thing with SHOW DEVICE /FULL output
when the F$GETDVI lexical function can do it
easily:
alp $ write sys$output f$getdvi( "dka0:", "freeblocks")
16733466
> You may want to describe the specific
> problem [...]
Another good idea. Asking how to implement a
particular poor solution to a problem is
often less useful than asking how to solve
the actual problem.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-11-2009 12:14 AM
тАО03-11-2009 12:14 AM
Re: DCL
1. I have a recording of monitor system command which is taken after every 5 mins
$
and this output is stored into files with time stamp in there name
2. I have to generate a report of last one week disk IO's
so I create a list of monitor record files into a list file
$ dir
3. then I read this file line by line and parse it to monitor command
$ open /read rec dir.lis
$ rdloop:
$ read /end_of_file=endit rec val
$ define /user sys$output monrep.out
$ pipe monitor disk /input='val | sea sys$input dka0
$ goto rdloop
$ append monrep.out;* monrep.report
4. then I read the monrep.report file and fetch out the desired information
$open /read inpt monrep.report
$ read /end_of_file=clsit inpt val2
$ val2=f$edit(val2,"compress,trim")
$ dsk=f$element(0,"",val2)
$ ios=f$element(4,"",val2)
QUERY
========
IN STEP 3 WHERE I AM DEFINING THE OUTPUT TO A FILE TO WRITE TO THE FILE IS THERE OTHER WAY TO DO THAT
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-11-2009 01:27 AM
тАО03-11-2009 01:27 AM
Re: DCL
Unless I misunderstood what you are trying to achieve....
Craig
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-11-2009 01:59 AM
тАО03-11-2009 01:59 AM