- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Re: Ask prompts
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
10-30-2006 04:04 AM
10-30-2006 04:04 AM
I want to be able to list backups logs with the current day , 30 days or 60 days listings?
Help!
So if I would choose option [C] for current I would only get 1 file for [30] 30 files for [60] 60 files. This is what I have so far?
$ read/prompt="[C]urrent, [30]days or [60]days " sys$command type
searchprod_admin:backup.log,backup.sav;* " ''thedate'",started/nowarn/noh^
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2006 04:38 AM
10-30-2006 04:38 AM
Solutiondon't know if I got it right, but you seem to have a logfile BACKUP.LOG, which contains started messages for each backup.
To search for specific dates, you should construct the variable THEDATE, e.g. if TYPE = 30:
$ THEDATE = F$CVTIME("TODAY-''type'-0","ABSOLUTE","DATE")
You may then search with
$ SEARCH BACKUP.LOG "started","''THEDATE'" /Match=and/Remaining
which shows you all entries since the specified date.
To list the savesets you may use the DIRECTORY command together with /SINCE and /BEFORE.
Btw: I would not use a variable named TYPE, because that may conflict with the DCL verb TYPE.
regards Kalle
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2006 04:38 AM
10-30-2006 04:38 AM
Re: Ask prompts
Prompting for the date is easy enough, convertign that to a real date is easy enough alsocheck out:
$HELP LEXI F$CVTIME
$help dcl_tips date_time combination
Example:
$ show time
30-OCT-2006 11:36:03
$ write sys$output f$cvt("today -30-","absolute")
30-SEP-2006 00:00:00.00
however... SEARCH will only look for exact strings and will not understand 'since'.
Please explain in even more detail the exact problm you are tryign to solve and perhaps attach a text file with a sample of the backup log and what you would want to find in there with a given input selection.
You may need to DCL or PERL script to read each record, extract a date and compare.
Hope this helps some,
Hein van den Heuvel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2006 04:56 AM
10-30-2006 04:56 AM
Re: Ask prompts
Have it ask first [D}etail or [S]ummary
If detail , I want to pull the backup info
from the backup.log and backup.sav;* files in prod_admin:
If summary, I want to pull it from Stats_dir:autodtat*.* files
Then I want it to ask for [C]urrent, 30day or 60 day. This is how many days from today they want to see the backup times for. I also want to give the Admin an Option of seeing it on the screen or printing it.
Thanks!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2006 05:58 AM
10-30-2006 05:58 AM
Re: Ask prompts
something along these lines:
.
.
.
Read_ds:
$ read sys$command DS /prompt="Detail or Summary?"
$ ds = f$extract(0,1,f$edit(Ds,"upcase,trim"))
$ If ds .eqs. "D" then goto detail
$ if ds .eqs. "S" then goto summary
$ Write sys$output " D or S !"
$ goto read_ds
.
. (similar for C_30_60)
. (similar for Screen_or_Print)
.
$ if C_30_60 .eqs. "C" then C_30_60 = 0
$ refdat = f$cvtim("today-''C_30_60'-,"absolute","date")
$
.
. processing from which enviroonment..
.
$ if screen_or_print .eqs. "S"
$ then
$ type/page/sin='refdat'
$ else
$ print /since ='refdat' .....
$ endif
You will have to do the formatting to your liking, and maybe add some more error handling, but this would be the general idea.
hth
Proost.
Have one on me.
jpe
.
$detail:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2006 06:37 AM
10-30-2006 06:37 AM
Re: Ask prompts
Thanks so much!!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2006 06:52 AM
10-30-2006 06:52 AM
Re: Ask prompts
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2006 09:09 AM
10-30-2006 09:09 AM
Re: Ask prompts
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2006 11:22 AM
10-30-2006 11:22 AM
Re: Ask prompts
Onfortunately you did not share enough information to exactly help you.
Specifically... where does the 'date' symbol come from (@DCL_SCREEN?) and what does it look like ($SHOW SYMB date)? Can it be changed?
The exact syntax for a combined date string is very critical and a little trick. be sure to experiment a lot with command recall and "$write sys$output f$cvtime(....".
You probably meant to write :
thedate=f$cvtime("''date' -00-","absolute","DATE")
Slightly more clear (IMHO) would be:
thedate=f$cvtime(date+ " -00-","absolute","DATE")
Now that menu option 2 and 3...
Is that going to set a range and then return to the menu. So the range will be called for example 'range'. Then the time code should probably look like:
thedate=f$cvtime("''date' -''range'-","absolute","DATE")
And you really should only assign 'thedate' in the common code, before the D/S split.
A more complete, but untested script, might look like:
:
$OPTION_0: $EXIT $OPTION_1:
$thedate=f$cvtime("''date' -''range'-","absolute","DATE") ! Unassigned range = 0
$ PUT "''SCR_L10'''SCR_BOLD'NOTE: choose D 0R S!''SCR_OFF'"
:
$ Write sys$output " D or S !"
$goto option_1
$ detail: :
summary:
:
$goto main_begin
$
$OPTION_2:
$read /prompt = "How many days old? " range
$! Validate range here
$goto option_1
$
OPTION_3: $read /prompt = "Which date" target-date
$! Validate target-date here
$date = target-date
$goto option_1
Good luck learning DCL!
Regards,
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2006 04:15 PM
10-30-2006 04:15 PM
Re: Ask prompts
When you say Current, 30, or 60 days, are you expecting just a single day's dispaly? Or do you need all of the last 30 or 60 days? If you need all days, you will have to set up a loop within the procedure where you create date symbols for "-30","-29","-28", etc. (either a symbol for each date concatenated in the search string, or multiple searches one day at a time).
Allan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2006 08:18 PM
10-30-2006 08:18 PM
Re: Ask prompts
The usage would be :-
$ ASKYESNO == "@location:ASKYESNO.COM"
$ ASKYESNO "Please enter the date range 'C', '30' or '60'" "" "" 2 "C#30#60" "UPCASE"
Please enter the date range 'C', '30' or '60' > 55
%AYN-E-INVINPUT, Your input was invalid. Please try again
Please enter the date range 'C', '30' or '60' > 60
Robert.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2006 08:45 PM
10-30-2006 08:45 PM
Re: Ask prompts
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2006 03:29 AM
10-31-2006 03:29 AM
Re: Ask prompts
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-02-2006 05:44 AM
11-02-2006 05:44 AM
Re: Ask prompts
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-02-2006 07:43 AM
11-02-2006 07:43 AM
Re: Ask prompts
instead of my bersion of this, let me give just my comments.
>>>>
$ NODE = F$GETSYI("NODENAME")
$ IF F$GETSYI("CLUSTER_MEMBER") THEN NODE=F$EXTRACT(0,5,NODE)
<<<<
What is your intention here? Nodenames can be up to 6 chars, but if you only want to use the 1st 5, then you achieve your goal. Otherwise, f$edit(node,"trim") will do better.
>>>>
$ SET PROC/PRIV=ALL
<<<<
I DETEST that, I really HATE it!.
I am of the opinion that privileges in VMS carry the wrong name. That name should be "RISK".
At the very least, the "ALL" should be removed from DCL systax, to have you/us take the trouble to enumerate all needed privs.
Find out what is needed, and enable ONLY those!
>>>>
.OR. (OPTION_NUM .GT. MAX_OPT)
<<<
Where does "max_opt" come from?
>>>>
thedate=f$cvtime(date+ " -00-","absolute
<<<
Syntax error. Replace with ("today+00-", ...
>>>
$ open/append outfile backup_save.tmp
$ close outfile
<<<
Please explain? As such this performs nothing. Maybe you still intend to add some activity, but until that...
But, all in all, things are growing!
Remember, HELP is always just a keyboard away. It would have told you some of the above much quicker!
Don't give up!
Proost.
Have one on me.
jpe