- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Re: Increment a year
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
тАО12-08-2010 02:18 PM
тАО12-08-2010 02:18 PM
Increment a year
I apologize if this is not the right form for this question.
My company got a maintenance contract for a VAX Basic program. I have no experience with this.
One of the changes I need to make is to change how the end date is calculated. Currently the end date is Dec 31 of the current year. I need to change that so that the end date is the same as the start date plus a year. So Dec 8 2010 start date and a Dec 8 2011 End Date.
How would I do something like this?
Thanks in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-08-2010 03:20 PM
тАО12-08-2010 03:20 PM
Re: Increment a year
> VAX Basic program.
Congratulations.
> I have no experience with this.
Perhaps those congratulations were premature.
> [...]
> How would I do something like this?
Ask the fellow who negotiated the contract?
Hire someone who has some related experience?
Did you really expect to get any useful
advice from people (who aren't getting paid
to do your job for you and, perhaps more
important) who can't see any of the existing
code?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-08-2010 03:36 PM
тАО12-08-2010 03:36 PM
Re: Increment a year
Personally, I have not used Basic since the '60s, and I don't recall there being dates in it. I do recall Beginner's All-purpose Symbolic Instruction Code.
Perhaps your program gets the date from Basic. Perhaps it gets it from VMS. Perhaps there is some other way. We have no way of knowing how your program does it. You are going to have to read the code.
Have fun.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-08-2010 04:15 PM
тАО12-08-2010 04:15 PM
Re: Increment a year
If the former, then post a snippet of the code that creates the end date now, and we can probably modify it.
If you are not familiar with Basic at all, perhaps someone should revisit the contract. To paraphrase Bob G in other notes: There are those of us here that provide consulting services for situations like this. Many of the posters here are consultants too.
Please update this and let us know, in detail, what you need.
Dan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-08-2010 08:58 PM
тАО12-08-2010 08:58 PM
Re: Increment a year
Why wouldn't the end date be Dec 7th in your example? Otherwise you will be adding 1 day each year.
How are you going to handle Feb 29th.
Jon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-08-2010 09:44 PM
тАО12-08-2010 09:44 PM
Re: Increment a year
$ HELP RTL LIB$
There are a bunch of lib$xxx functions which change the format of a date/time representation back-and-forth (string, 64-bit internal VMS, array of integers).
There's one to get the format in a structure with year/month/day represented in integers. Increment the year and call the suitable lib$xxx function to get it back to the format you need in your BASIC code.
Don't forget the handling of leap years (the fun part).
/Guenther
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-09-2010 02:42 AM
тАО12-09-2010 02:42 AM
Re: Increment a year
Welcome to the HP ITRC OpenVMS Forum.
There is no single "correct" way to calculate the date one year hence. The precise method required depends upon the manner in which the date information is stored within the program.
There are also questions of definition. Is one year 365 days? Or is it the corresponding date (e.g., December 31) one year hence? There is a difference: leap years.
That said, the most common interpretation that I have seen in one year hence, same date. To avoid performing a separate leap year calculation, I would recommend breaking the TOY (time of year) into its component parts (using SYS$BINTIM and SYS$NUMTIM system services); incrementing the year; and then re-integrating the numeric time components back to an appropriate form. The preceding presumes that the expiration date has been stored in the standard OpenVMS time format.
Having provided technical backstop to several Y2K projects, I can assure you that there are a great number of ways to store dates, and the first and most important step is to determine how the date is currently being stored (and in what formats and locations; there may very well be more than one).
@Dan: Thank you for the reference. Indeed, the forum is best (and most appropriately) used as a communal mind, to ease research and assist memory. Using the forum for "crowd sourcing" code writing would be inappropriate. Specific modifications to proprietary code are appropriately a consulting matter outside of this forum.
- Bob Gezelter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-15-2010 03:57 PM
тАО12-15-2010 03:57 PM
Re: Increment a year
newYear% = newYear% + 1
Sorry to waste your time with such a easy question.