- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Re: DCL Command procedure output
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
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
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
08-01-2008 06:25 AM
08-01-2008 06:25 AM
DCL Command procedure output
Is there a way to type this file from a procedure running in batch mode to the screen?
I tried to define sys$output to sys$input or sys$command and was not successful. I evne thought of read/sys$command, however I am not sure that will work. Please help. Here is part of the procedure:
$chk_file_and_delete:
$! DELETE THE WORK FILES
$
$ if hour .eq. 07 .and. min .eq. 00
$ then
$ delete idxdailyrpts:cache_license_usage_pmca1*.rpt;*
$ endif
$
$ delete dsa0:[cachesys.pmca1.mgr]all.dmp;*
$ delete idxdailywrks:cache_license_pmca1.tmp;*
$ purge/keep=2 idxdailylogs:cache_license_usage.log
$
$!-----------------------------------------------------------------------------
$
$ open/write/error=write_err fil1 idxdailywrks:cache_license_pmca1.tmp
$ wf1 = "write fil1"
$
$ wf1 "$ CACHE -"""U""" """%SYS""""
$ wf1 "SET SECID="""OPERATOR""""
$ wf1 "Do $System.License.DumpLocalAll()"
$ wf1 "H"
$ close fil1
$
$ @idxdailywrks:cache_license_pmca1.tmp
$
$!-----------------------------------------------------------------------------
$! CREATE FILE WITH CURRENT DATA
$
$ if f$search("idxdailyrpts:cache_license_usage_pmca1_''date'.rpt") .eqs. ""
$ then
$ goto first_run
$ else
$ goto not_first_run
$ endif
$
$!-----------------------------------------------------------------------------
$
$first_run:
$
$ open/write/error=write_err outfil idxdailyrpts:cache_license_usage_pmca1_'dat
e'.rpt
$ open/read/error=read_err infil DSA0:[CACHESYS.PMCA1.MGR]all.dmp
$ wo = "write outfil"
$
$! TITLE INFORMATION
$
$ wrd1 = "CACHE"
$ wrd2 = "LICENSE"
$ wrd3 = "USAGE"
$ wrd4 = "FOR"
$ wrd5 = "PMCA1"
$ wrd6 = "''wkday',"
$ wrd7 = "''mdy'"
$
$! HEADER INFORMATION
$
$ wrd9 = "Time"
$ wrd10= "Current Use"
$ wrd11= "License Capacity"
$ wrd12= "Units Remaining"
$
$ txt1 = f$fao("!20* !5AS !7AS !5AS !3AS !5AS !10AS !12AS" ,wrd1,wrd2,wrd3,wrd
4,wrd5,wrd6,wrd7)
$ txt2 = f$fao("!17AS !17AS !17AS !17AS",wrd9,wrd10,wrd11,wrd12)
$ wo "''txt1'"
$ wo ""
$ wo "''txt2'"
$ wo ""
$
$ read/end=endit infil line
$ lic_cap = f$elem(1,"=",line)
$ lic_cap = f$edit(f$ext(0,f$loc(",",lic_cap),lic_cap),"trim")
$ cur_use = f$elem(2,"=",line)
$ cur_use = f$edit(f$ext(0,f$loc(",",cur_use),cur_use),"trim")
$ unit_remain = f$edit(f$elem(3,"=",line),"trim")
$
$ txt3 = f$fao("!17AS !17AS !17AS !17AS",hrmin,cur_use,lic_cap,unit_remain)
$ wo "''txt3'"
$
$ close infil
$ close outfil
$ goto mail_it
$
$!----------------------------------------------------------------------------
$
$not_first_run:
$
$ open/append/error=write_err outfil idxdailyrpts:cache_license_usage'date'.rpt
$ open/read/error=read_err infil DSA0:[CACHESYS.PMCA1.MGR]all.dmp
$ wo = "write outfil"
$
$ read/end=endit infil line
$ lic_cap = f$elem(1,"=",line)
$ lic_cap = f$edit(f$ext(0,f$loc(",",lic_cap),lic_cap),"trim")
$ cur_use = f$elem(2,"=",line)
$ cur_use = f$edit(f$ext(0,f$loc(",",cur_use),cur_use),"trim")
$ unit_remain = f$edit(f$elem(3,"=",line),"trim")
$
$ txt3 = f$fao("!17AS !17AS !17AS !17AS",hrmin,cur_use,lic_cap,unit_remain)
$ wo "''txt3'"
$
$ close infil
$ close outfil
$ goto mail_it
$!----------------------------------------------------------------------------
$mail_it:
$
$ if hour .eq. 17
$ then
$ mail_time = f$ext(0,5,f$cvt("","absolute","time"))
$ mail/subject="Cache license Usage PMCA1 on ''mdy' ''mail_time'" -
idxdailyrpts:cache_license_usage_pmca1_'date'.rpt "''maildis'"
$ else
$ mail_time = f$ext(0,5,f$cvt("","absolute","time"))
$ mail/subject="Cache license Usage PMCA1 on ''mdy' ''mail_time'" -
idxdailyrpts:cache_license_usage_pmca1_'date'.rpt "''gildis'"
$ endif
$ set noverify
$ exit
$
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2008 06:41 AM
08-01-2008 06:41 AM
Re: DCL Command procedure output
>>>
Is there a way to type this file from a procedure running in batch mode to the screen?
<<<
Is the job really running in batch mode?
How do you even know your terminal is online & logged-in?
But if you do get around that:
determine the device name of the intended terminal, and
$ TYPE
should do the trick.
hth
Proost.
Have one on me.
jpe
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2008 06:53 AM
08-01-2008 06:53 AM
Re: DCL Command procedure output
In a batch job , is the sys$output the command procedure's log file?
So how would I determine the terminal?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2008 07:33 AM
08-01-2008 07:33 AM
Re: DCL Command procedure output
So you want to identify the 'terminal' for
the window to receive the message and provide that to the job. Yuck.
My preference would be to select a window to run receive the output and just spawn a job to get teh data in a loop, or type the file create by the batch job.
Something simple like
$ spaw/nowait/inpu=nl:/proc=license_watch @license_watch.com
Where license_watch.com looks something like:
$loop:
$type license.tmp
$wait 0:5:0 ! Every 5 minutes?
$goto loop
$crash system if we get here
If you really want the data to go to all logged in terminal and really want an Email all teh time, then you can be 'cute' and use the Email personal name to convey the data:
$MAIL/PERS="your text here"
Maybe
$ mail/subject="Cache license Usage PMCA1 on ''mdy' ''mail_time'" -
/pers="''txt3' -
idxdailyrpts:cache_license_usage_pmca1_'date'.rpt "''maildis'"
[fwiw... What a horrible script, and what a horrible task it is trying to do ]
Enjoy,
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2008 08:09 AM
08-01-2008 08:09 AM
Re: DCL Command procedure output
How about
$ reply/user=xxxxxx "your text"
?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2008 08:20 AM
08-01-2008 08:20 AM
Re: DCL Command procedure output
> command procedure's log file?
The batch job's log file.
> So how would I determine the terminal?
From a batch job? I don't see how, but you
could tell it. Instead of submitting the
batch job directly, run another procedure
which does f$trnlnm( "sys$command"), and then
submits the batch job, passing the terminal
name to the batch job (/PARAMETERS = ...),
which can then write whatever it wants to
that terminal (if it has permission).
You really wish to do this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2008 12:38 AM
08-04-2008 12:38 AM
Re: DCL Command procedure output
Not sure why you would want to but this should work:
In your (terminal) login set a system wide logical to point to your terminal:
Something like:
def/sys term_outp 'f$getjpi("","terminal")
In your batch job:
Copy file ''term_outp'
Not reliable (will only type to last term logged in and if terminal is still logged in)
Not considered good practice putting extra stuff in system log tables but having said that should give you what you asked for.
Regards
Paul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2008 06:44 AM
08-04-2008 06:44 AM
Re: DCL Command procedure output
Run the procedure directly from your Reflections X Window system session; from an X terminal login.
You might need to toss the procedure into the 15 minute loop or such, but that's easier than making batch interactive.
As an enhancement here, I'd tend to automate whatever secondary eye-ball or manual processing is needed here (monitoring Cache license units?), and run this entirely offline; whether via batch job or as a daemon. Or (for an interactive display) I'd run it behind a web server CGI or such, and particular run with graphical displays. I'd get out of the business of having to look at a local terminal display or the mail every fifteen minutes. (Or the data could be pulled via RSS or such as required.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2008 07:41 AM
08-04-2008 07:41 AM
Re: DCL Command procedure output
If auditors are interested in the output then better maybe to keep records.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2008 09:04 AM
08-04-2008 09:04 AM
Re: DCL Command procedure output
I have been task to monitor our Cache license usage during the day at some perticular interval and be aware of this through out the day and at end of of the day send a report of all the times to management. This will help to determine if we need to increase our licenses, since are are adding users at once a month, sometimes more.
So I wanted a way in which I can run a command procedure that will display the usage to my Reflection window rather than have to read an email with the current usage.
Paul if I open one window and run my procedure under a perticular username will that be ok since every window creates a unique terminal ID. ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2008 10:28 AM
08-04-2008 10:28 AM
Re: DCL Command procedure output
$ ccontrol stat xxxx -a0 "-L1"
where xxxx is your Cache config name? Filter leaving only the lines with "licenses" and you should see something like this.
$ pipe ccont stat xxxx -a0 "-L1" | sear sys$pipe licenses
Current Licenses available = 127
Minimum Licenses available = 125
Total Licenses available = 128
Maybe you want more info - maybe less. Filter as you choose. Then, just place that command line in a command procedure and "$ spawn/nowait" it from the terminal where your logged in...
$loop:
$ pipe ccont stat xxxx -a0 "-L1" | sear sys$pipe licenses
$ wait 00:15
$ goto loop
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2008 11:45 AM
08-04-2008 11:45 AM
Re: DCL Command procedure output
It is easy to code the DCL to post up the periodic messages when invoked interactively, and to keep a running average over the day, and to accumulate min and max values by storing the data in an RMS file. (An RMS file does this nicely, and you can then run a tool to calculate the min, max and running_average, if your DCL doesn't preemptively write it.)
You could conceivably use a modified version of your existing DCL running in batch (forever) and (with basic RMS sharing) have your periodic query tool look at the most recent activity in the RMS indexed file.
Or your existing batch job can notify via OPCOM traffic; via REQUEST or REPLY messages.
If you want to make somebody that likes statistics happy, write the data as XML -- DCL can write XML nicely -- and pass the logs over to the statistician(s). (Run a web server on the OpenVMS box and you can serve up the data that way, too.)
Or code some tools on your mail client to receive and process and tabulate the data from the existing batch job. Various mail clients are programmable.
or both.
Having one piece of code doing both (and from batch) is rather more work. It's easier to have a "data collector" and a "data display" component, in my experience.
In aggregate, a baseline solution for this is probably about two hours of DCL coding and testing. If that. If you want graphics displays and CGI, a little more time.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2008 01:36 PM
08-04-2008 01:36 PM
Re: DCL Command procedure output
$ pipe convert T4_MYNODE_30JUL2008_0000_2358_CACHE.CSV/share sys$output |
sort sys$pipe /key=(pos:10,siz:2) /nodup sys$output
provides a fast status check and quickly lets you know if a closer look is called for.
Using the T4 framework has the advantage of minimizing drift during monitoring generating samples at near regular intervals. Once data is collected you can use EXCEL, TLVIZ or CSVPNG to create graphic display suitable for the PowerPoint set.
Andy Bustamante