- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Re: Modifying DCL script
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
тАО06-15-2011 10:26 AM
тАО06-15-2011 10:26 AM
Re: Modifying DCL script
$ if p1.eqs."#PROCESS#" then goto process
$ pipe SEARCH ssfmoni:erf.log - JHF,Failed/match=and/window=1 | @'f$environ("PROCEDURE")' #PROCESS#
$ exit
$process:
$ now = f$time()
$loop:
$ read/end=end/err=end sys$pipe line
$ write sys$output line
$! parse the line to extract the time into symbol errtime
$! and get the difference between now and errtime:
$ dtime=f$delta_time(errtime,now)
$ dd=f$integer(f$element(0," ",dtime)) !day
$ dt=f$element(1," ",dtime)
$ dh=f$integer(f$element(0,":",dt)) !hour
$ dm=f$integer(f$element(1,":",dt)) !minute
$ if dd.eq.0 .and. dh.eq.0 .and. dm.le.15
$ then
$ write sys$output line
$! do whatever You want with the selected line (write to a mailbox ?)
$ endif
$ goto loop
$end:
$ exit
where the 'parse line' part only You, the OP, knows the syntax or format of the log lines.
DCL has the lexical functions f$extract,f$element,f$length,f$fao to help in parsing a string.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-15-2011 10:41 AM
тАО06-15-2011 10:41 AM
Re: Modifying DCL script
$ pipe SEARCH ssfmoni:erf.log JHF,Failed/match=and/window=1 | @'f$environ("PROCEDURE")' #PROCESS#
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-15-2011 10:56 AM
тАО06-15-2011 10:56 AM
Re: Modifying DCL script
$ hour = f$cvtime(,"ABSOLUTE","HOUR")
$ minute = f$cvtime(,"ABSOLUTE","MINUTE")
$ day = f$cvtime(,"ABSOLUTE","DAY")
etc...
is easier and a whole lot more obvious...
Or better, using delta times or combination times and not trying to do time math, given that home-grown time math tends to introduce errors and particularly errors around the daylight saving time switch-overs. (If y'all don't understand what the delta time, combination time and absolute time formats can provide, please go see the DCL documentation.)
For details on the f$cvtime lexical function, please see the arguments listing and description from:
HELP LEXICAL F$CVTIME
Or see the two-volume DCL reference manual in the OpenVMS documentation set available at:
http://www.hp.com/go/openvms/doc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-16-2011 03:56 AM
тАО06-16-2011 03:56 AM
Re: Modifying DCL script
$ dtime=f$delta_time(errtime,now,"DCL")
$ dd= f$cvtime(dtime,"DELTA","DAY") !days
$ dh= f$cvtime(dtime,"DELTA","HOUR") !hour
$ dm= f$cvtime(dtime,"DELTA","MINUTE") !minute
$ if dd.eq.0 .and. dh.eq.0 .and. dm.le.15 ...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-16-2011 05:18 AM
тАО06-16-2011 05:18 AM
Re: Modifying DCL script
>> $ dtime=f$delta_time(errtime,now,"DCL")
>> $ dd= f$cvtime(dtime,"DELTA","DAY") !days
:
>> $ if dd.eq.0 .and. dh.eq.0 .and. dm.le.15 ...
Huh?
$ dtime=f$delta_time(errtime,f$time())
$ show symb dtime
DTIME = " 0 00:13:03.73"
$ if dtime .le. " 0 00:15:00.00" ...
$ ! That's 3 spaces before the 0 for the days
fwiw,
Hein
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-16-2011 05:21 AM
тАО06-16-2011 05:21 AM
Re: Modifying DCL script
Hein>>> $ if dtime .le. " 0 00:15:00.00" ...
That's a STRING compare and should read
$ if dtime .LES. " 0 00:15:00.00" ...
( Of course if it was up to me I'd write the whole search and compare in perl, allthough admittedly the VMS time convert to second is a bit of a hassle. )
Hein
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-16-2011 06:08 AM
тАО06-16-2011 06:08 AM
Re: Modifying DCL script
My example extracts delta time into integers.
And "DCL" caveat:
$ dtime=f$delta_time("today","tomorrow")
$ write sys$output f$cvtime(dtime,"DELTA","DAY")
%DCL-W-IVDTIME, invalid delta time - use DDDD-HH:MM:SS.CC format
\1 00:00:00.00\
"DCL" fiormat:
$ dtime=f$delta_time("today","tomorrow","DCL")
$ write sys$output f$cvtime(dtime,"DELTA","DAY")
1
$
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-16-2011 02:36 PM
тАО06-16-2011 02:36 PM
Re: Modifying DCL script
I thought you had 2 problems with:
$ dtime=f$delta_time(errtime,now,"DCL")
The 'now' must have been a symbol, but can not be the mighty tempting "NOW"... for that you need just a double double quote = empty string.
The "DCL" was new to me. It is not documented in the help, and with the line failing a simple cut & paste test I thought that was the problem at first.
I Learned something new.
I do think comparing the strings is much more readable than picking it apart, followed by the compound checking of those parts.
Hein
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-16-2011 03:11 PM - last edited on тАО08-02-2011 06:39 AM by Kevin_Paul
тАО06-16-2011 03:11 PM - last edited on тАО08-02-2011 06:39 AM by Kevin_Paul
Re: Modifying DCL script
Hein,
The 3rd parameter of F$DELTA can be "ASCTIM" or "DCL". Default is "ASCTIM".
This was a late addition, after F$DELTA had been released into the wild. It was necessary because of the inconsistencies in date formats. I think it was one of the last things Guy did before he left. Maybe the documentation never got through the system?
BTW, this is an example of a change to VMS instigated by an ITRC discussion. See http://h30499.www3.hp.com/t5/Languages-and-Scripting/F-DELTA-TIME-returns-a-non-standard-delta-time-format/m-p/3546489#M1114
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-17-2011 02:03 AM
тАО06-17-2011 02:03 AM
Re: Modifying DCL script
Thanks a lot for all your replies, i was able to get a new logic for getting the data for the 15 min interval,
The logic used here is:
Took the copy of the log file for the current day during the first run and took the copy of the log file again during the next run that is after 15 min interval.
checked the difference between the 2 log files and got the output to another file, now searching the new file for the error will give the error message for the last 15 min interval.
i am using the assign command for getting the output for the file differences.