- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- SUbtracting in OpenVMS
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
09-22-2010 08:42 AM
09-22-2010 08:42 AM
Re: SUbtracting in OpenVMS
What is "the file date" in contrast to creation date ?
f$file(file,"CDT") creation date
f$file(file,"RDT") modification/revision date
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2010 09:15 AM
09-22-2010 09:15 AM
Re: SUbtracting in OpenVMS
The bottom line here is that a more detailed description of the ultimate goal is needed.
Dan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2010 09:32 AM
09-22-2010 09:32 AM
Re: SUbtracting in OpenVMS
$ Month="NULL,JAN,FEB,MAR,APR,MAY,JUN,JUL,AUG,SEP,OCT,NOV,DEC,"
$ file_date = "20100527"
$ Yr = f$extr(0,4,File_Date)
$ Mth = f$extr(4,2,File_Date)
$ Mth = f$elem(Mth,",",Month)
$ Day = f$extr(6,2,file_date)
$ ADate = Day + "-" + Mth + "-" + Yr
$ show symb adate
ADATE = "27-MAY-2010"
Dave
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2010 10:26 AM
09-22-2010 10:26 AM
Re: SUbtracting in OpenVMS
>>
I am writing a COM to rename a group of files which satisfy the below condition. The File name has the current date and time
Example: 20100919103344
If the difference between the current date (20100920) and the file date (20100919) is greater than 1, then i need to do certain steps.
<<
Use the the following command-file:
$! @this p1=filespecification of form yyyymmddhhmmss.ext
$!old date : more than 1 day before today
$ olddate=f$cvtim("yesterday-1-","COMPARISON","DATE")-"-"-"-"
$ filedate = f$extract(0,8,f$parse(p1,,,"NAME","SYNTAX_ONLY"))
$ if filedate.les.olddate
$ then
$ write sys$output "File ",p1," is older than 1 day."
$! do what has to be done with this file...
$! rename 'p1' [.destination] !or whatelse...
$ endif
And call it for each file in question as the argument:
@this 'filespec'
assuming 1 day difference of date wanted, not "older than 24 hours".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2010 07:37 PM
09-22-2010 07:37 PM
Re: SUbtracting in OpenVMS
Let me be clear with my question:
We have Jobs, which first create a TEMP File and write all the records into that. After the successful completion of the Job, the TEMP file will be renamed to the corresponding extension by the same job.
Example : abc_20100922033445.TR_TEMP (Starting of the Job)
will be renamed to
abc_20100922033445.TR (After Successful completion of the Job)
Due to various reasons, the job is failing everyday which is unavoidable. So, I have been given a task to rename the TEMP file to their corresponding extensions if they are more than 1 Day old.
The reason we check for the 1 day criteria is because, we should not rename a file which is being currently used by the Job.
The rename command is very straight forward and nothing complex.
example: $Ren /log [logical_name]abc_20100922033445.TR_TEMP [logical_name]abc_20100922033445.TR
I hope i am clear with my question. If you are not clear, please revert back to me.
----------------------------------
Hi Jan, i will check the CDT again. If that works fine , then i can use that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2010 11:03 PM
09-22-2010 11:03 PM
Re: SUbtracting in OpenVMS
That looks promising!
A RENAME does not modify CDT (CreateDateTime), so you can simply use that.
I assume from our questions that you are more accustomed to the Unix-style of file date, where there is only ONE date, being the date of last "touch".
VMS file metadata holds multiple dates, of which CDT is one, and it looks like the one you need.
Good luck!
Proost.
Have one on me.
jpe
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2010 12:39 AM
09-23-2010 12:39 AM
Re: SUbtracting in OpenVMS
I looked again at your Example:
>>>
abc_20100922033445.TR_TEMP (Starting of the Job)
will be renamed to
abc_20100922033445.TR (After Successful completion of the Job)
<<<
Well, this may even be a one-liner:
$ RENAME *.TR_TEMP *.TR /BEFORE=TESTERDAY
I DO advice to include the directory spec in the command:
$ RENAME trlogdir:*.TR_TEMP *.TR /BEFORE=YESTERDAY
Lookup HELP LEXICAL F$CVTIME if you need finer time spec, eg /BEFORE=f$CVTIM("TODAY-30:0:0") --- everything before 18:00 the day before yesterday or
/BEFORE=f$CVTIM("-30:0:0") --- 30 hours before time of execution of the command
hth
Proost.
Have one on me.
jpe
abc_20100922033445.TR_TEMP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2010 08:41 AM
10-11-2010 08:41 AM
Re: SUbtracting in OpenVMS
I have used the below commands to achieve the renaming issue.
$ Month="NULL,JAN,FEB,MAR,APR,MAY,JUN,JUL,AUG,SEP,OCT,NOV,DEC,"
$ file_date = "20100527"
$ Yr = f$extr(0,4,File_Date)
$ Mth = f$extr(4,2,File_Date)
$ Mth = f$elem(Mth,",",Month)
$ Day = f$extr(6,2,file_date)
$ ADate = Day + "-" + Mth + "-" + Yr
$ show symb adate
ADATE = "27-MAY-2010"
the comment from DBA is that, i am using the above code repetitively..
The suggestion from my DBA is that they want me to use subroutines.
he also said "subroutines can be made to act like functions by using global symbols which you initialize just before calling the routine."
can someone help in how to create a subroutine.
Thanks....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2010 09:11 AM
10-11-2010 09:11 AM
Re: SUbtracting in OpenVMS
> subroutine.
Help? You want help? Have you tried HELP?
help subroutine
help call
help gosub
help return
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2010 09:36 PM
10-11-2010 09:36 PM
Re: SUbtracting in OpenVMS
i found the help and it solved my issue....
- « Previous
-
- 1
- 2
- Next »