wil...@evax0.eng.fsu.edu writes:
> Hello,
> This is a repost of the VMS delay command item (with signature
> included). Strange things happen when your PROFILE settings mysteriously
> disappear. Once again, is there an interactive command that can be used
> to delay the execution of a DCL procedure (not SUBMIT)? Thanks in advance.--
It is true that the WAIT command will do what you want.
I wish that DEC would modify WAIT to allow for WAIT/UNTIL=time
Here is some code from mdchaney in vms_share format that takes care of this
problem.
=============================================================================
Following is a share file for a new and improved "wait" command.
Basically, it just allows you to use a "/until" qualifier and specify an
absolute time.
It comes with a "descrip.mms" file. If you don't have mms:
1. macro and link "wait_until"
2. define wait_until full_path:wait_until (alternately, put
executable in sys$system)
3. set command wait/replace
4. library/help/extract=wait/out=wait.hlp sys$help:helplib
5. edit/sum wait.hlp/update=waithlp.dif
6. following that step, you have a new wait.hlp, which you
can add to a private library or the system help (not really
fully suggested.)
Any questions, mdchaney@iubacs, mdcha...@ucs.indiana.edu.
Darrin
--
mdchaney@iubacs
mdcha...@bronze.ucs.indiana.edu
mdcha...@rose.ucs.indiana.edu
$! ------------------ CUT HERE -----------------------
$ v='f$verify(f$trnlnm("SHARE_VERIFY"))'
$!
$! This archive created by VMS_SHARE Version 7.2-007 22-FEB-1990
$! On 22-JUL-1991 13:11:46.10 By user MDCHANEY
$!
$! This VMS_SHARE Written by:
$! Andy Harper, Kings College London UK
$!
$! Acknowledgements to:
$! James Gray - Original VMS_SHARE
$! Michael Bednarek - Original Concept and implementation
$!
$! TO UNPACK THIS SHARE FILE, CONCATENATE ALL PARTS IN ORDER
$! AND EXECUTE AS A COMMAND PROCEDURE ( @name )
$!
$! THE FOLLOWING FILE(S) WILL BE CREATED AFTER UNPACKING:
$! 1. DESCRIP.MMS;3
$! 2. WAIT.CLD;8
$! 3. WAITHLP.DIF;1
$! 4. WAIT_UNTIL.MAR;4
$!
$set="set"
$set symbol/scope=(nolocal,noglobal)
$f=f$parse("SHARE_TEMP","SYS$SCRATCH:.TMP_"+f$getjpi("","PID"))
$e="write sys$error ""%UNPACK"", "
$w="write sys$output ""%UNPACK"", "
$ if f$trnlnm("SHARE_LOG") then $ w = "!"
$ ve=f$getsyi("version")
$ if ve-f$extract(0,1,ve) .ges. "4.4" then $ goto START
$ e "-E-OLDVER, Must run at least VMS 4.4"
$ v=f$verify(v)
$ exit 44
$UNPACK: SUBROUTINE ! P1=filename, P2=checksum
$ if f$search(P1) .eqs. "" then $ goto file_absent
$ e "-W-EXISTS, File ''P1' exists. Skipped."
$ delete 'f'*
$ exit
$file_absent:
$ if f$parse(P1) .nes. "" then $ goto dirok
$ dn=f$parse(P1,,,"DIRECTORY")
$ w "-I-CREDIR, Creating directory ''dn'."
$ create/dir 'dn'
$ if $status then $ goto dirok
$ e "-E-CREDIRFAIL, Unable to create ''dn'. File skipped."
$ delete 'f'*
$ exit
$dirok:
$ w "-I-PROCESS, Processing file ''P1'."
$ if .not. f$verify() then $ define/user sys$output nl:
$ EDIT/TPU/NOSEC/NODIS/COM=SYS$INPUT 'f'/OUT='P1'
PROCEDURE Unpacker ON_ERROR ENDON_ERROR;SET(FACILITY_NAME,"UNPACK");SET(
SUCCESS,OFF);SET(INFORMATIONAL,OFF);f:=GET_INFO(COMMAND_LINE,"file_name");b:=
CREATE_BUFFER(f,f);p:=SPAN(" ")@r&LINE_END;POSITION(BEGINNING_OF(b));
LOOP EXITIF SEARCH(p,FORWARD)=0;POSITION(r);ERASE(r);ENDLOOP;POSITION(
BEGINNING_OF(b));g:=0;LOOP EXITIF MARK(NONE)=END_OF(b);x:=ERASE_CHARACTER(1);
IF g=0 THEN IF x="X" THEN MOVE_VERTICAL(1);ENDIF;IF x="V" THEN APPEND_LINE;
MOVE_HORIZONTAL(-CURRENT_OFFSET);MOVE_VERTICAL(1);ENDIF;IF x="+" THEN g:=1;
ERASE_LINE;ENDIF;ELSE IF x="-" THEN IF INDEX(CURRENT_LINE,"+-+-+-+-+-+-+-+")=
1 THEN g:=0;ENDIF;ENDIF;ERASE_LINE;ENDIF;ENDLOOP;t:="0123456789ABCDEF";
POSITION(BEGINNING_OF(b));LOOP r:=SEARCH("`",FORWARD);EXITIF r=0;POSITION(r);
ERASE(r);x1:=INDEX(t,ERASE_CHARACTER(1))-1;x2:=INDEX(t,ERASE_CHARACTER(1))-1;
COPY_TEXT(ASCII(16*x1+x2));ENDLOOP;WRITE_FILE(b,GET_INFO(COMMAND_LINE,
"output_file"));ENDPROCEDURE;Unpacker;QUIT;
$ delete/nolog 'f'*
$ CHECKSUM 'P1'
$ IF CHECKSUM$CHECKSUM .eqs. P2 THEN $ EXIT
$ e "-E-CHKSMFAIL, Checksum of ''P1' failed."
$ ENDSUBROUTINE
$START:
$ create 'f'
X!makefile for extended wait command
X* : wait_help, wait_until.exe
X @- write sys$output "Finished making wait..."
X
Xwait_help :`20
X library/help/extract=wait/out=wait.hlp sys$help:helplib
X edit/sum wait.hlp/update=waithlp.dif
X
X.last
X - purgex/nolog/noconf
X - deletex/nolog/noconf wait_until.obj.*
$ CALL UNPACK DESCRIP.MMS;3 1898280681
$ create 'f'
Xdefine verb WAIT
X image "wait_until"
X parameter p1,value(type=$deltatime,default="0")
X qualifier until,value(type=$datetime,required),syntax=wait_until
X
Xdefine syntax wait_until
X noparameters
$ CALL UNPACK WAIT.CLD;8 1768640860
$ create 'f'
X- 2, 5
X Places the current process in a state of hibernation for a specified
X interval of time, or, alternately, until a certain time.
X- 10, 10
X WAIT `5B/UNTIL=absolute-time`5D `5Bdelta-time`5D
X
X If the "/UNTIL" qualifier is used, the delta-time may not be`20
X specified.
X- 25, 26
X the command to have any effect, you must supply a time value. If
X the "/UNTIL" qualifier is used, you may not specify a delta-time.
X
X2 Qualifiers
X</UNTIL
X /UNTIL=absolute-time
X
X Specifies an absolute time at which the process will wakeup. Note
X that if the time is in the past, no wait will occur. For help on
X absolute time specification, see "Help Specify Date_Time Absolute"
X- 47
X
X 2. $ Loop:
X $ Run Beta
X $ Wait/Until=Tomorrow
X $ Goto Loop
X
X In this example, the user has a program that runs daily. By using
X the "/UNTIL" qualifier, the program will wait until the next day,
X then continue.
X/
$ CALL UNPACK WAITHLP.DIF;1 2087479619
$ create 'f'
X .Title Wait_Until Implement "wait/until" DCL command
X .Ident 'V01-00'
X .Show MEB
X
X;By: M Darrin Chaney
X;Date: July 22, 1991AD
X;
X;Used with wait.cld, allows a new qualifier, "/until", that allows use of an
X;absolute time value.
X
X .PSect Data,NoShr,Wrt
X
XAscii_Time: .BlkB 24
XQuad_Time: .BlkQ 1
X
XAscii_Time_Des: .Long 24
X .Address Ascii_Time
X
X .PSect Data_NoWrt,NoWrt,Shr
X
XP1: .AsciD /P1/
XUntil: .AsciD /UNTIL/
X
XGet_Value_P1_Args:
X .Long 3
X .Address P1
X .Address Ascii_Time_Des
X .Address Ascii_Time_Des
X
XGet_Value_Until_Args:`20
X .Long 3
X .Address Until
X .Address Ascii_Time_Des
X .Address Ascii_Time_Des
X
XPresent_Arg: .Long 1
X .Address Until
X
XBinTime_Args: $BinTim TimBuf=Ascii_Time_Des, -
X TimAdr=Quad_Time
X
XSchdWk_Args: $SchdWk DayTim=Quad_Time
X
X .PSect Code,Long,Shr,NoWrt
X
X .Entry Wait_Until,`5EM<>
X
X CallG Present_Arg,G`5ECLI$Present ;See if "/until" is presen
Vt
X BLBS R0,Use_Until_Value ;use that value if so
X
X CallG Get_Value_P1_Args, -
X G`5ECLI$Get_Value ;get p1 value
X BLBC R0,Bye ;there must be a problem
X
X BrB Onward ;onward
X
XUse_Until_Value:
X
X CallG Get_Value_Until_Args, -
X G`5ECLI$Get_Value ;get the value on "/until"
X BLBC R0,Bye ;leave on error
X
XOnward:
X CallG BinTime_Args,G`5ESys$BinTim ;change to binary format
X BLBC R0,Bye ;leave on error
X
X CallG SchdWk_Args,G`5ESys$SchdWk ;schedule a wakeup call
X BLBC R0,Bye ;leave on error
X
X CallS S`5E#0,G`5ESys$Hiber ;hibernate until wakeup
V call
X
XBye: Ret ;Return to DCL
X
X .End Wait_Until
$ CALL UNPACK WAIT_UNTIL.MAR;4 1331383439
$ v=f$verify(v)
$ EXIT
--
mdchaney@iubacs
mdcha...@bronze.ucs.indiana.edu
mdcha...@rose.ucs.indiana.edu
--
| Disclaimer: (is it bedda dan dat claimer?)
Bob Boyd | My opinions are mine, mine, mine! Horrors that
r...@epavax.rtpnc.epa.gov | anyone would confuse them with those of Unisys
Unisys/EPA | or the Environmental Protection Agency! No Way!
--
| Disclaimer: (is it bedda dan dat claimer?)
Bob Boyd | My opinions are mine, mine, mine! Horrors that
r...@epavax.rtpnc.epa.gov | anyone would confuse them with those of Unisys
Unisys/EPA | or the Environmental Protection Agency! No Way!