- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Re: submiting a job based on the day of the week
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
тАО04-06-2005 09:59 AM
тАО04-06-2005 09:59 AM
Re: submiting a job based on the day of the week
For slightly more language independence give the work to DCL. You can code for several languages (but *complete* language independence might be a bit voluminous) like this:
$ ON WARNING THEN GOTO UnexpectedDay
$ GOTO DAY_'F$CVTIME(,,"WEEKDAY")
$ UnexpectedDay:
$ ! Error Trap
$ EXIT
$ ...
$ DAY_Sunday:
$ DAY_Saturday:
$ DAY_Dimanche:
$ DAY_weekend-in-your-language:
$ ! Weekend branch
$ GOTO BackToMainLine
$
$ DAY_Monday:
$ DAY_Tuesday:
$ DAY_Wednesday:
$ etc...
$ ! Weekday branch
$ GOTO BackToMainLine
If you're running V8.2 or higher, there are more options. Specifically we can eliminate all language dependencies.
1-JAN-1990 was a Monday, so:
$ J=F$DELTA("1-JAN-1990",F$TIME())
$ D=J-J/7*7
will return 0 for Monday, 1 for Tuesday etc... So your test for a weekend day becomes simply:
$ IF D.GE.5
$ THEN
$ ! weekend branch
$ ELSE
$ ! weekday branch
$ ENDIF
WARNING - since Delta times are limited to 10000 days, the above code will fail for dates after May 2017.
I think I'll a suggestion that F$CVTIME(date,"COMPARISON","WEEKDAY") should return a number...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-06-2005 12:35 PM
тАО04-06-2005 12:35 PM
Re: submiting a job based on the day of the week
>>
>> $ J=F$DELTA("1-JAN-1990",F$TIME())
>> $ D=J-J/7*7
Ah... My kinda thinking, but I did not have V8 to try. Good.
>> the above code will fail for dates after May 2017.
or you could just start closer in.
>> I think I'll a suggestion that F$CVTIME(date,"COMPARISON","WEEKDAY") should return a number...
I suppose you could call it a a low impact bug, as "MONTH" already does the right thing for ABS vs COMPARE
Cheers,
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-06-2005 06:51 PM
тАО04-06-2005 06:51 PM
Re: submiting a job based on the day of the week
>I suppose you could call it a a low impact bug, as "MONTH" already does the right thing for ABS vs COMPARE
Unfortunately it's not quite as simple as it seems at first. The default output format is "COMPARISON", so to do this in a safe, upwards compatible manner, we'd have to change the default output format for "WEEKDAY" to "ABSOLUTE" and return numeric values only if the output format was explicitly "COMPARISON". It's probably more difficult to describe in the documentation than actually implement...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-07-2005 08:16 AM
тАО04-07-2005 08:16 AM
Re: submiting a job based on the day of the week
Sorry I didn't reply sooner. Thank you for all your responses. I "TRULY" appreciate the help. I won't be able to work on this issue until Monday. Bosses are always changing priorities. I will keep you posted on my progress. Thanks again.
Sincerely,
Pat
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-07-2005 08:53 AM
тАО04-07-2005 08:53 AM
Re: submiting a job based on the day of the week
(Smile) Perhaps I was unclear, I did write that response in a hurry.
I meant to say:
- If you find "Saturday" or "Sunday", then you are ok.
- If no string matches, take some appropriate action (error message: "Language not English"... If I had the time, I would delve into the multi-language support, my recollection is that there is a clean way to tell if your language is English, but it should not be too hard to find in the manual.
- Bob Gezelter, http://www.rlgsc.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-07-2005 09:06 AM
тАО04-07-2005 09:06 AM
Re: submiting a job based on the day of the week
(LNM$SYSTEM_TABLE)
"SYS$LANGUAGE" = "ENGLISH"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-08-2005 09:25 AM
тАО04-08-2005 09:25 AM
Re: submiting a job based on the day of the week
A freeware international solution of the day of week might include something like this using symbols:
$! Is_Weekend.com
$! Defines weekend names.
$weekend==""
$weekend_day_1=""
$weekend_day_2=""
$if (f$trnlnm("SYS$LANGUAGE")) .eqs. "ENGLISH"
$THEN
$ weekend_table=="Saturday,Sunday"
$ weekend_day_1=="Saturday"
$ weekend_day_2=="Sunday"
$ELSE
$! Non-English Customizations
$ENDIF
.
.
.
$exit
or it could be done with system logicals.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-08-2005 05:28 PM
тАО04-08-2005 05:28 PM
Re: submiting a job based on the day of the week
Cheers,
Robert
- « Previous
-
- 1
- 2
- Next »