Perhaps this sample EXEC will help get you started. It's a bit old, but I
believe its still pretty accurate. Use it as a starting point.
BTW, its on our Y-disk as "WAKEUP EXECSAMP" so that anyone looking for
"WAKEUP" will stumble across it. DO NOT save it as "WAKEUP EXEC".
Instead, pick a different name. Our WAKEUP-driven SVMs all had this as a
starting point, but called: SINK EXEC. The SVM's PROFILE EXECs perform
some set-up work, then generally execute:
'CP SET PF01 EXEC SINK'
queue 'EXEC SINK'
Exit 0
Mike Walter
Hewitt Associates
The opinions expressed herein are mine alone, not my employer's.
---<snip>---
/* Prolog See Epilog for additional information ********************
* Exec Name - WAKEUP EXECSAMP *
* Unit Support - OSS/VM *
* Status - Version 1, Release 1.0 *
********************************************************************/
/* Notice: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! *
* It is STRONGLY RECOMMENDED that you do NOT name this *
* as "WAKEUP EXEC" (or execs that run in the "address CMS" *
* environment will run this before "WAKEUP MODULE *"! *
* "WAKEUP MODULE". A better name might be "SINK EXEC". *
* This is named "WAKEUP EXECSAMP" just so that it shows up *
* when entering "FILELIST WAKEUP * *" *
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
address COMMAND
parse source xos xct xfn xft xfm xcmd xenvir .
parse upper arg parms 1 operands '(' options ')' parmrest
If operands='?' then Signal Explain
Signal ON Syntax
Signal ON NoValue
/* Signal ON ERROR */
/* Save a few initial settings */
parse value diag(08,'CP QUERY SET') with . 'CPCONIO' $cpconio .
If cmsflag('CMSTYPE') then $cmstype='RT'
else $cmstype='HT'
'SET CMSTYPE HT'
'CP SET CPCONIO IUCV' /* Intercept all CP console IO with IUCV */
'WAKEUP +0 (NOEXT IUCVMSG QUIET'
'SET CMSTYPE' $cmstype /* Restore cmstype */
Do forever
'CONWAIT'
'DESBUF'
'WAKEUP' operands '(CONS APPC EXT IO IUCVMSG NOREAD RDR SMSG' ,
'TIME VMCF FILE(WAKEUP TIMES *)'
wrc = rc
parse pull . wakedate waketime .
/* Get past midnight */
If waketime > '23:57:30' then 'CP SLEEP 3 MIN'
/**************************************************************/
/* Some event occurred - see what to do. */
/* Return codes from 'WAKEUP' as follows: */
/* */
/* -2 - 1st time invocation from CMS Subset (invalid) */
/* 0 - Nothing to wait for--all timer file options done */
/* 1 - VMCF or SMSG arrived & stacked */
/* 2 - WAKEUP 'time' operand has elapsed */
/* 3 - Time from 'WAKEUP TIMES' file reached */
/* 4 - Reader File of proper class has arrived */
/* 5 - IUCVMSG has arrived */
/* 6 - Virtual Cons. Interrupt (ENTER, PA1, PFn, etc.) */
/* 7 - I/O interrupt (EXCEPT console, whish is rc=6) */
/* 8 - External interrupt */
/* 100 - Explanation from 'WAKEUP ?" complete */
/* 101 - Empty file in card rdr, RDR option (FSREAD rc) */
/* 103 - Unknown card rdr error, RDR option (FSREAD rc) */
/**************************************************************/
Select
When wrc=1 then /* VMCF or MSGS arrived */
Do
parse pull msgtype userid msgtext
say msgtype userid msgtext
End
When wrc=2 then /* TIME +mm expired */
Do
say 'TIME +mm expired:' wakedate waketime
End
When wrc=3 then /* WAKEUP Time reached */
Do
parse pull . RecNo RecordFromFile
say 'WAKEUP TIME reached:' RecNo RecordFromFile
End
When wrc=4 then /* RDR file arrived */
Do
/* We'll call EXIT to keep from looping on the same */
/* reader file. You COULD perform some other reader */
/* file processing (perhaps CALL a sub-routine to do it.)*/
say 'A Reader file arrived, ending' xfn xft xfm
Call Exit 0
End
When wrc=5 then /* IUCVMSG interrupt */
Do
parse pull msgtype userid msgtext
say msgtype userid msgtext
End
When wrc=6 then /* Console interrupt */
Do
say 'Console interrupt at' time 'on' date,
'-' xfn 'ending.'
Call Exit wrc
End
When wrc=7 then /* non-CONS I/O intrpt */
Do
parse pull irpttype devaddr csw csw1 csw2
say 'I/O interrupt:' irpttype devaddr csw csw1 csw2
End
When wrc=8 then /* EXT interrupt */
Do
parse pull irpttype InterruptCode
say 'EXTernal interrupt:' irpttype InterruptCode
End
Otherwise /* Unknown Return Code */
Do
say 'Error return code from WAKEUP =' wrc
Call Exit wrc
End
End /* Select */
End /* forever */
/********************************************************************/
/* Sub-Routines below this point */
/********************************************************************/
Exit:
parse arg exitrc todo
'CP SET CPCONIO' $cpconio /* Restore initial setting */
If todo='?' then say 'For more help, enter:' xfn '?'
If verify(exitrc,'-0123456789')>0 then Exit 999999
Exit exitrc
Error:
etxt.1='+++ "ERROR:" error rtn entered in:' xfn xft xfm', rc='rc
etxt.2='+++ from line:' sigl', which reads:'
etxt.3='+++'sourceline(sigl)
cmdline=strip(sourceline(sigl),'B')
cmdline=value('CMDLINE')
etxt.4='+++ which translates to:' cmdline
etxt.0=4
'PIPE STEM etxt. | CONS'
Call Exit 20
Syntax:
etxt.1='+++ "SYNTAX:" error rtn entered in:' xfn xft xfm', rc='rc
etxt.2='+++ from line:' sigl', which reads:'
etxt.3='+++'sourceline(sigl)
cmdline=strip(sourceline(sigl),'B')
cmdline=value('CMDLINE')
etxt.4='+++ which translates to:' cmdline
etxt.0=4
'PIPE STEM etxt. | CONS'
Call Exit 20
NoValue:
etxt.1='+++ "NoValue:" error rtn entered in:' xfn xft xfm', rc='rc
etxt.2='+++ from line:' sigl', which reads:'
etxt.3='+++'sourceline(sigl)
etxt.4='+++ Variable with no value is:' condition('Description')
etxt.0=4
'PIPE STEM etxt. | CONS'
Call Exit 24
Explain:
'PIPE (NAME Explain)' ,
'| <' xfn xft xfm ,
'| INSIDE /ExplainBegin:/ /ExplainEnd:/' ,
'| PREFACE STRLITERAL /'xfn xft xfm 'help.../' ,
'| CONSOLE'
Call Exit 0
/*
ExplainBegin:
===> Place command description and syntax here, between
===> lines beginning with "ExplainBegin:" and "ExplainEnd:"
===> A sample "railroad-style" syntax is shown below.
+-default operands--+
>>-Cmdname--+-------------------+--+-------------------+---------------><
+-optional operands-+ +-(-| Options |-+---+
+-)-+
|-Options-|
ExplainEnd:
*/
/* Epilog ***********************************************************
* Function - Sample EXEC to process WAKEUP module functions. *
* Component of - WAKEUP module (from CMS Utilities Facility) *
* Command format- WAKEUP <at> <hh:mm<:ss>> *
* <+<hh:>mm<:ss>> *
* - For more information enter: HELP CMS WAKEUP *
* Called by - User from console *
* Dependencies - VM/SP 3 or higher. *
* WAKEUP MODULE *
* WAKEUP TIMES (parm file for WAKEUP event - *
* a sample of this is WAKEUP TIMES Y2) *
* Program Lang. - CMS REXX *
* Date Written - 19880707 *
* Author - Michael R. Walter *
* Changed | By | Description of Change *
* --------+-----+------------------------------------------------- *
* 20001024 mrw - Add 'APPC' option *
* 20081013 mrw - Save/restore CMSTYPE and CPCONIO settings. *
* *
********************************************************************/
---<snip>---
"Scott Rohling" <[email protected]>
Sent by: "The IBM z/VM Operating System" <[email protected]>
09/22/2010 10:05 AM
Please respond to
"The IBM z/VM Operating System" <[email protected]>
To
[email protected]
cc
Subject
Re: Problems with WAKEUP
Another clue from HELP WAKEUP:
Seven WAKEUP options cause data to be stacked: EXT, FILE, IO, IUCVMSG,
SMSG,
TIME, and VMCF. WAKEUP stacks the data in the following order regardless
of
the order the options are specified when you invoke
WAKEUP:
1. Current date and
time
2. Line from the WAKEUP TIMES file, or an asterisk (*) if no line is
found
3. An IUCV, SMSG or VMCF message, or EXT or IO interrupt
data.
Note: In general, the last line stacked by WAKEUP is the one you really
want
to use, not the first
line.
Scott Rohling
On Wed, Sep 22, 2010 at 9:00 AM, Scott Rohling <[email protected]>
wrote:
Not sure it's quite that simple - I too have had issues using FILE and
IUCVMSG within VMUTIL. Been awhile but I think the cause stems from this
(HELP WAKEUP):
When FILE is specified, WAKEUP will always stack the line from the file
(or a null line if no line was found) before exiting, even if the cause of
the WAKEUP was not timer expiration. The stacked line has the following
format:
* recno record-from-file
where recno is the record number of the line in the file, and
record-from-file is as much of the record as will fit on the stack.
As I recall - I would have these entries in the stack, which then had to
be tossed as they weren't 'real' timer entries.
There are some code examples under HELP WAKEUP that might help ...
Scott Rohling
On Wed, Sep 22, 2010 at 8:48 AM, Frank M. Ramaekers <[email protected]
> wrote:
Just one ?WAKEUP (SMSG FILE?. Test the RC to see which interrupted it.
Frank M. Ramaekers Jr.
From: The IBM z/VM Operating System [mailto:[email protected]] On
Behalf Of Mark Workman
Sent: Wednesday, September 22, 2010 9:46 AM
To: [email protected]
Subject: Problems with WAKEUP
I am fairly new to VM and having some problems with WAKEUP.
I have a server that runs a WAKEUP EXEC that uses the FILE parameter. I
need to run an additional WAKEUP EXEC that uses the SMSG parameter.
My question is can I incorporate the 'WAKEUP (SMSG' in the same FOREVER
loop as the other WAKEUP EXEC? I am seeing errors that make me think this
will not work this way. Or do I have to create another server to run my
other WAKEUP EXEC (i.e. 1 server runs the WAKEUP (FILE and another server
runs the WAKEUP (SMSG) ?
Thanks in advance,
Mark Workman
Shelter Insurance Companies
573.214.4672
[email protected]
This e-mail is intended only for its addressee and may contain information
that is privileged, confidential, or otherwise protected from disclosure.
If
you have received this communication in error, please notify us
immediately by
e-mailing [email protected]; then delete the original
message.
_____________________________________________________ This message
contains information which is privileged and confidential and is solely
for the use of the intended recipient. If you are not the intended
recipient, be aware that any review, disclosure, copying, distribution, or
use of the contents of this message is strictly prohibited. If you have
received this in error, please destroy it immediately and notify us at
[email protected].
The information contained in this e-mail and any accompanying documents may
contain information that is confidential or otherwise protected from
disclosure. If you are not the intended recipient of this message, or if this
message has been addressed to you in error, please immediately alert the sender
by reply e-mail and then delete this message, including any attachments. Any
dissemination, distribution or other use of the contents of this message by
anyone other than the intended recipient is strictly prohibited. All messages
sent to and from this e-mail address may be monitored as permitted by
applicable law and regulations to ensure compliance with our internal policies
and to protect our business. E-mails are not secure and cannot be guaranteed to
be error free as they can be intercepted, amended, lost or destroyed, or
contain viruses. You are deemed to have accepted these risks if you communicate
with us by e-mail.