LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (February 1999, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 5 Feb 1999 10:28:21 -0500
Reply-To:     MICHAEL.RAITHEL@RAITHM49.CUSTOMS.SPRINT.COM
Sender:       "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From:         "Michael A. Raithel" <MICHAEL.RAITHEL@RAITHM49.CUSTOMS.SPRINT.COM>
Subject:      (MVS) Re: MVS wait,sleep

Dan Konkler posted/reposted (in part) the following:

>I posted this a couple days ago and got some responses but >they have suggested thigs I've already tried. So ive >copied the sas log for the 4 things ive tried. > >Anyone know how to do a wait in a batch SAS job on mvs? >In AF i use call wait(x) to do it. Sas seems to have >implemented a different function or call routine on every >platform to do the same thing. right now i'm reduced to >looping from 1 to 2000 in a cpu loop because i want a >fraction of a second delay and there should be a better >way. Dan >

(The rest of Dan's posting can be found below the Sig line, below).

Dan, unfortunately there is no SLEEP function in OS/390 (MVS), so your own particular coding efforts are in vain. I hesitated to reply to your post because I expected one or more of two very talented SAS-under-MVS programmers to reply with clever work-arounds that they posted to the 'L in the past. They must be busy, so I'll mention their two great methodologies:

First, the inimitable Paul Dorfman beat me out in an elegant solution to this problem in September of 1997. You can find his full posting in the archives under the following heading:

>Date: Mon, 29 Sep 1997 17:18:50 -0700 >From: Paul Dorfman <PDORFMA@UCS.ATT.COM> >Subject: MVS equiv of PC SAS sleep() function? >

The gist of his posting is, in his own words:

>If you need to cause a delay within a data step you can >either use this code excerpt > >DROP IT; IT = TIME(); DO WHILE(TIME()-IT < 20); END; > >directly anywhere within the data step hardcoding the >number of seconds desired (in this case 20). Alternatively >(my preference) one could store a macro like > >%MACRO SLEEP(S); >DROP IT; IT = TIME(); >DO WHILE(TIME()-IT < &S); END; >%MEND; >

This is a _GREAT_ piece of code; simple, to the point and effective.

Secondly, the clever Paul Shipley presented a cool method of putting a SAS program to sleep in February of 1998. It involves compiling an assembler program (once) and then calling it from within any SAS program that you want to wait. It is very straightforward, so don't let the "assembler" part scare you! Paul's posting is a bit long; here is the relevant header information (so you can look it up):

>Date: Wed, 25 Feb 1998 06:29:00 +1000 >From: "Shipley, Paul [IBM GSA]" ><PShipley@VITGSSW.TELSTRA.COM.AU> >Subject: Re: how to send to sleep an MVS SAS Job? >

Paul's code is a _GREAT_ "out of the box" solution.

Dan, it is always a drag to bump up against SAS System limitations. But, with the kind of talent that we have contributing to SAS-L, those limitations hardly stand a chance! Best of luck in giving your SAS programs a good nap!

I hope that this suggestion proves helpful now, and in the future!

Of course, all of these opinions and insights are my own, and do not reflect those of my organization or my associates.

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Michael A. Raithel "The man who wrote the book on performance" E-mail: maraithel@erols.com Author: Tuning SAS Applications in the MVS Environment +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ...I get by with a little help from my friends... - The Beatles +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

>Here are attempts I've made already (this in on MVS): > >10 data _null_; >11 x = sleep(2); >----- >68 >12 run; > >ERROR 68-185: The function SLEEP is unknown. 13 data >_null_; >14 x = wait(2); >---- >68 >15 run; > >ERROR 68-185: The function WAIT is unknown. 16 data >_null_; >17 call wait(2); >---- >251 >18 run; > >ERROR 251-185: The subroutine WAIT is not known to SAS. >Check your >spelling. >19 data _null_; >20 call sleep(2); >----- >251 >21 run; > >ERROR 251-185: The subroutine SLEEP is not known to SAS. >Check your spelling.


Back to: Top of message | Previous page | Main SAS-L page