[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference noted::hackers_v1

Title:-={ H A C K E R S }=-
Notice:Write locked - see NOTED::HACKERS
Moderator:DIEHRD::MORRIS
Created:Thu Feb 20 1986
Last Modified:Mon Aug 03 1992
Last Successful Update:Fri Jun 06 1997
Number of topics:680
Total number of notes:5456

303.0. "What time would you like that, sir?" by MDR292::WALL (I see the middle kingdom...) Tue Sep 02 1986 16:32

    Greetings
    
    One of the parts of my job is maintaining and modifying a DCL command
    procedure used by the people that run our application.  My grip
    of DCL is shaky at best, and as I don't have a single volume of
    the VMS doc set in my possession, I thought I would appeal to the
    knowledgeable people out there, who will probably be able to solve
    this in their sleep.
    
    Basically, this command procedure gathers some information from
    a user about certain options available when our application is run,
    and it builds another command procedure, submits a batch job, and
    all is hunky-dory.
    
    However, the resulting batch jobs are gargantuan resource consumers,
    (from necessity) and it has occurred to someone that it would be
    good if one could specify a delay in the command procedure so that
    this cluster of multiple 8650s does not choke on these batch jobs.
    
    So, what I'm looking to do is get either an absolute time or a
    specified delay from the user and just slap it on the end of the
    submit command already in the procedure.
    
    I'm envisioning something like this:
    
    $ inquire delay "When do you want the batch job to start [immediately]"
    
    	{ magic to turn the answer into something I can add to a submit
    	command }
    
    $ submit stuff /after={result of the magic}
    
    Help?
    
    Dave W.
T.RTitleUserPersonal
Name
DateLines
303.1No magic needed hereWHYVAX::HAMPTONTue Sep 02 1986 16:5630
    If you make the user enter the time exactly as SUBMIT expects it,
    you won't need any magic.  Actually, this is probably the most
    reasonable approach.  You can use absolute, delta, or combination
    time.  Absolute time format is:
    
         [dd-mmm-yyyy[:]][hh:mm:ss.cc]
    
    or the keywords
    
         TODAY
         TOMORROW
         YESTERDAY
    
    For example, 15-APR-1986:12 is 12 noon on April 15, 1986.  15-::30
    is 00:30 o'clock on the 15th day of the current month.
    
    Delta time format is
    
         [dddd-][hh:mm:ss.cc]
    
    The "dddd" is days.  For example, 3- is three days from now.  3-:30
    is three days and thirty minutes from now.  You cannot use delta
    time in the SUBMIT command (I don't think).
    
    Finally, combination time is absolute plus or minus a delta time.
    For example, +5 is current time plus five hours.  15-APR:+:5 is
    12:05 AM on April 15th of the current year.  TOMORROW+1-00:00 is
    tomorrow plus one day.
    
    Hope this helps.
303.2A real exampleFROST::HARRIMANACK Phfft!Wed Sep 03 1986 12:0422
    The actual "how to" approach can be something like this:
    
    $ read/prompt="What time would you like this to submit"/err=...-
      sys$command submit_time

    $ submit_time = f$edit(submit_time,"UPCASE,TRIM")! filter input
    $ if submit_time .eqs. "" then submit_time = "0" ! null = now
    $ if f$locate(submit_time,"f$").ne.f$length(submit_time) then -
      goto gotcha				! anti-hacker code
    $ if f$locate(submit_time,"@").ne.f$length(submit_time) then -
      goto gotcha				! ditto
    
    $ submit/after='submit_time' 'file_to_submit'
    
    ....
    
    
    Although you cannot use delta times in the submit command, "0"
    in the /AFTER switch means "now". Hope it helps.
    
    /pjh
    
303.3It was five minutes work...MDR292::WALLI see the middle kingdom...Wed Sep 03 1986 14:125
    
    Thanks to all.  Remembering that putting something in single quotes
    is how to get its value was my only hurdle.
    
    Dave W.
303.4you forget "'", but here's a better wayREGINA::OSMANand silos to fill before I feep, and silos to fill before I feepWed Sep 03 1986 15:5719
>    $ if f$locate(submit_time,"f$").ne.f$length(submit_time) then -
>      goto gotcha				! anti-hacker code
>    $ if f$locate(submit_time,"@").ne.f$length(submit_time) then -
>      goto gotcha				! ditto
>    
>    $ submit/after='submit_time' 'file_to_submit'
    
    
    "f$" and "@" are an incomplete list of things you need
    to check to avoid "gotchas".  You need to check for "'" too
    (apostrophe).  Perhaps a more elegant solution, one that doesn't
    require you to know which tidbits you need to check for, is this:
                                          
    $ on warning the goto gotcha
    $ submit_time = f$cvtime (submit_time)
    $ submit/after='submit_time' 'file_to_submit'

                                                                   
      										e         /Eric
303.5Nit. "0" = previous midnight, not now.DELNI::CANTORDave CantorThu Sep 04 1986 01:0815
      Re .2
      
      >    Although you cannot use delta times in the submit command,
      >    "0" in the /AFTER switch [sic] means "now". Hope it helps. 
    
      "0" in the /AFTER qualifier means midnight today; _i.e._,
      00:00:00.00 of the current day.  However, that is always either
      "right now" or in the past and has the effect of scheduling
      the job to be run immediately, as intended.
      
      Also, you certainly *can* use delta times in the submit command;
      _e.g._, $ SUBMIT/AFTER="+1-2:0" ! 26 hours from now
              $              "TOMORROW+8" ! 8:00 a.m. tomorrow

      Dave C.
303.6picky, picky...FROST::HARRIMANACK Phfft!Thu Sep 04 1986 16:0334
    re: .5
    
    	I stand corrected. Quote from DCL-780:
    
    	"You can specify either an absolute time or a combination of
    absolute and delta times. see Section 2.5 for complete information
    on specifying times and values" - that's NOT just delta times according
    to them!
    
    	verbatim from VMSHELP 4.4:
    

SUBMIT

  /AFTER=absolute-time
   /NOAFTER
   Holds the job until the specified time. If the time has passed,
   processes the job immediately. Time can be an absolute time or a
   combination of absolute and delta times.
                                                   
    Besides, we are arguing semantics. if "0" means midnight and it's
    past midnight, the job will start. Therefore it means "now". Isn't
    it just as easy to say one thing as the other? they're both right.
    
    
    re: .4
    
    yeah, I know that's not all you have to look for, however, without
    knowing how much Dave is letting the users get into in the first
    place you may or may not have to check for the "other" stuff...
    Checking for time using f$time is a better idea (that means you're
    right, Eric) 
    
    Gods, you hackers are such perfectionists!