Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login




Remember Me
Forgot Password?
Join Us!

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.
Jobs from Indeed

Link To This Forum!

Partner Button
Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

How do you sleep on TSO Rexx?Helpful Member!(2) 

cpjust (Programmer) (OP)
24 Jan 07 14:20
Hi,
I'm using TSO Rexx on z/OS.  What is the proper (most efficient) way to sleep for x seconds?  I could write a loop that keeps checking the time, but that would take up a hell of a lot of resources.
rexxhead (Programmer)
24 Jan 07 16:30
Never make an interactive process wait.  If you find yourself doing that, it should prompt you to redesign the task.

Frank Clarke
Tampa Area REXX Programmers' Alliance
REXX Language Assn Listmaster

Helpful Member!  cpjust (Programmer) (OP)
24 Jan 07 16:59
I'm not really sure what you mean?

I'm writing some QA tests in Rexx, and some tests need other jobs to run before the test to setup the environment properly.  When I submit a job in Rexx, it immediately runs the next line instead of waiting for the job to end.  So I wanted to sleep for a while to give the job time to end.  (I know that's not the best way to do it, but for QA purposes, it's good enough)
B4db0y (Programmer)
25 Jan 07 7:39
Let the Job start the Rexx Again or another Rexx.

Never ever let a Task sleep!


Best regards
B4db0y

____________________________________________________________
So Long, and Thanks for All the Fish

rexxhead (Programmer)
25 Jan 07 8:25
That's the first time I've heard someone in QA say "..that's good enough." winky smile

Do you have some requirement that says job#2 must run immediately after job#1?  If so, then the last step of job#1 should submit job#2.

Interactive processes should never 'sleep'.  It's unfair to others who share the system's resources.  What do you think would happen to response time if everyone did this?

Frank Clarke
Tampa Area REXX Programmers' Alliance
REXX Language Assn Listmaster

cpjust (Programmer) (OP)
25 Jan 07 11:03

Quote (rexxhead):

Interactive processes should never 'sleep'.  It's unfair to others who share the system's resources.  What do you think would happen to response time if everyone did this?
I'm not sure how z/OS sleeps (or if it even can), but on a good OS like UNIX or Windows when a program calls the OS's sleep API, that thread is just suspended for the amount of time specified and control is given to other programs.  Why would z/OS be any different?
rexxhead (Programmer)
25 Jan 07 13:25
It's enough that it is different: each TSO user is a separate JOB and follows the rules for jobs.  You occupy an initiator and share CPU time.  Dispatching algorithms typically give a higher initial priority for tasks that seem to be 'busy'.  When you go into a non-IO loop, you are very busy and the OS feeds you time until you cross the threshhold that says "uh-oh, this thing's on fire...".  It is possible that you could, with the right kind of sleep loop, shut out every other user on the system... until you '322'.

Do it often enough and you'll find that your dispatching priority is inexplicably lower than everyone else's...

Frank Clarke
Tampa Area REXX Programmers' Alliance
REXX Language Assn Listmaster

cpjust (Programmer) (OP)
25 Jan 07 15:35
That's why I was asking if there was a way to sleep other than using a loop.  Such as telling z/OS to give the CPU to someone else and continue processing my program in x seconds.
rexxhead (Programmer)
25 Jan 07 16:06

STIMER WAIT, but this is not implemented for any language except Assembler.  Sorry.

Frank Clarke
Tampa Area REXX Programmers' Alliance
REXX Language Assn Listmaster

cpjust (Programmer) (OP)
25 Jan 07 19:59
Crap...  sad

If I get someone to write me a SLEEP() TSO command that uses the STIMER WAIT instruction, will Rexx wait until the SLEEP command is finished waiting, or will it immediately go to the next line...?
Helpful Member!  kevinf2349 (TechnicalUser)
25 Jan 07 22:33
Why not just issue a PULL and then hit the button when the job has finished...quick and dirty but it will work.

Other than that.....I have a little assembler program that you can have that allows you to pass a wait time to it.

http://www.angelfire.com/ga/bowstore/bslbr14m.html
cpjust (Programmer) (OP)
25 Jan 07 22:52
Wow, thanks.
I tried downloading, but it says the file isn't found.

I'd rather not have to hit any buttons while it's running the tests, since I'd have to do it quite a few times.  I'd like to run my Rexx script in a JCL job and let it run while I'm at lunch or over night, then analyze the results when it's done.

Does your download also include the source code for the program?  I'm sure the developers would want to take a quick look at it before I run it, since I'm basically running as God (SPECIAL, OPERATIONS on RACF, and the equivalent on ACF2 & TSS).
kevinf2349 (TechnicalUser)
25 Jan 07 23:15
The ZIP file is there now. Sorry about that. The file is the source code.

Hope it helps.
cpjust (Programmer) (OP)
26 Jan 07 0:04
Hmmm...  I still can't download it.
Does  http://www.angelfire.com/ga/bowstore/BSLBR14.ZIP  work for you?
I could get the .txt file, but not the .zip or xmit file.
kevinf2349 (TechnicalUser)
26 Jan 07 8:42
Hmmm....tell you what...email me at

bowstore....@......hotmail.com (remove the dots)

and I will send you the file that way.
cpjust (Programmer) (OP)
26 Jan 07 9:51
I don't know what the problem was, but I was able to download it from work today.
I'll try it out as soon as the developers look it over and compile it for me.
Thanks!  smile
cpjust (Programmer) (OP)
26 Jan 07 12:26
Hi,
Just to let everyone know (and others who are also wondering how to sleep in Rexx), one of the developers here showed me a much easier way to sleep in Rexx.  Here's a Rexx SLEEP script I made:

CODE

/* REXX */
/* Sleeps for the specified number of seconds.                        */
/********1*********2*********3*********4*********5*********6*********7*/

SIGNAL ON ERROR

PARSE ARG seconds

IF seconds = "" THEN
   CALL BadSyntax

IF DATATYPE( seconds, 'W' ) == 0 THEN
   DO
      SAY "ERROR!  seconds parameter must be a whole number!"
      CALL BadSyntax
   END

CALL SYSCALLS 'ON'
ADDRESS SYSCALL

"sleep" seconds

CALL SYSCALLS 'OFF'
EXIT 0


/** BadSyntax()
 *  Prints the correct syntax...
 */
BadSyntax:  PROCEDURE
   SAY "Syntax error!"
   SAY ""
   SAY "Syntax:  SLEEP( seconds )"
   CALL SYSCALLS 'OFF'
EXIT 1


/** ERROR
 *  Called when an ERROR signal occurs.
 */
ERROR:
   SAY "ERROR!  Killing Rexx script."
   CALL SYSCALLS 'OFF'
   EXIT 1

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Back To Forum

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close