- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Re: VMS COM: IF cur_hour .eq. num1 or num2 failing
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
02-15-2006 07:57 AM
02-15-2006 07:57 AM
VMS COM: IF cur_hour .eq. num1 or num2 failing
Thanks,
- Martin
$!**********************************
$! Run @ 7 AM or 7 PM, based on cur_hour
$!*****************************************
$ if (cur_hour .eq. 7) .Or. (cur_hour .eq. 19) then
$ write sys$output cur_hour
14
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2006 08:02 AM
02-15-2006 08:02 AM
Re: VMS COM: IF cur_hour .eq. num1 or num2 failing
$ if (cur_hour .eq. 7) .Or. (cur_hour .eq. 19)
$ Then
$ write sys$output cur_hour
$ endif
regards Kalle
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2006 08:04 AM
02-15-2006 08:04 AM
Re: VMS COM: IF cur_hour .eq. num1 or num2 failing
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2006 08:05 AM
02-15-2006 08:05 AM
Re: VMS COM: IF cur_hour .eq. num1 or num2 failing
$!**********************************
$! Run @ 7 AM or 7 PM, based on cur_hour
$!*****************************************
$ cur_hour = f$cvtime(,,"hour")
$ if (cur_hour .eq. 7) .Or. (cur_hour .eq. 19)
$ then
$ write sys$output cur_hour
$ endif
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2006 08:06 AM
02-15-2006 08:06 AM
Re: VMS COM: IF cur_hour .eq. num1 or num2 failing
how do you define the symbol cur_hour ?
Try this (maybe)
$ cur_hour = f$cvtime("",,"hour")
$ if (cur_hour .eq. 7) .Or. (cur_hour .eq. 19) then write sys$output cur_hour
You can get help about the lexical f$cvtime with
$ help lex f$cvtime
Hope that helps
Regards
Heinz
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2006 08:11 AM
02-15-2006 08:11 AM
Re: VMS COM: IF cur_hour .eq. num1 or num2 failing
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2006 08:12 AM
02-15-2006 08:12 AM
Re: VMS COM: IF cur_hour .eq. num1 or num2 failing
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2006 08:12 AM
02-15-2006 08:12 AM
Re: VMS COM: IF cur_hour .eq. num1 or num2 failing
As written, the "IF" statement has a null argument and does nothing. In order to associate the "write" statement with the "IF" statement you need to append a "-" continuation character to the "IF" command line (or alternatively place the entire command - "if" and "write" - on a single line).
$ if (cur_hour .eq. 7) .Or. (cur_hour .eq. 19) then -
write sys$output cur_hour
Or use the block structure that others have suggested. Either will work. The block structure that others have suggested will permit you to execute multiple commands between the
$ if
$ then
$ ! insert
$ ! command
$ ! lines
$ ! here
$ endif
rather than a single conditional command when the block structure is not used.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2006 08:16 AM
02-15-2006 08:16 AM
Re: VMS COM: IF cur_hour .eq. num1 or num2 failing
Not to mention that if "cur_hour" is the direct output of F$CVTIME, then it is in a string format, not an integer.
- Bob Gezelter, http://www.rlgsc.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2006 08:35 AM
02-15-2006 08:35 AM
Re: VMS COM: IF cur_hour .eq. num1 or num2 failing
ASDEV1» $ cur_hour = f$cvtime(,,"hour")
ASDEV1» write sys$output cur_hour
16
ASDEV1» if cur_hour .eq. 16 then write sys$output cur_hour
16
ASDEV1»
Lawrence
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2006 12:20 PM
02-15-2006 12:20 PM
Re: VMS COM: IF cur_hour .eq. num1 or num2 failing
So it does. Strange. I cannot reproduce the case at this instant, but I seem to remember chasing a client problem where the answer was that the client had used .EQ. instead of .EQS. and was surprised.
I do not have the precise case at my fingertips (and my quick attempt to reproduce does not coincide with my memory), so I must be missing something.
My apologies.
- Bob Gezelter, http://www.rlgsc.com