- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- 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
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
тАО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. ?