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 (July 2000, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Fri, 7 Jul 2000 13:12:31 -0600
Reply-To:   Jack Hamilton <JackHamilton@FIRSTHEALTH.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Jack Hamilton <JackHamilton@FIRSTHEALTH.COM>
Subject:   Re: call execute
Comments:   To: David.Bocobo@BMS.COM
Content-Type:   text/plain; charset=us-ascii

Like so many things, it's explained in P-222, Changes and Enhancements to Base SAS Software, Release 6.07. It's also in the version 8 documentation. CALL EXECUTE was introduced in version 5.18, but wasn't in the initial release of version 6, which is why you couldn't find it in the documentation.

Basically (and this is a simplification), you call it in a datastep, passing it a string expression. Typically (but not always) you call it multiple times. All of the string expressions are concatenated together and executed after the data step finishes execution. You're using SAS code to generate more SAS code (a self-modifying program).

Here's a very simple example:

---------- 1 data _null_; 2 call execute('proc contents data=sasuser.iris; run;'); 3 run;

NOTE: DATA statement used the following computer resources: Buffered IO: 37 Elapsed time: 0 00:00:00.44 Direct IO: 29 CPU time: 0 00:00:00.08 Page Faults: 56

NOTE: CALL EXECUTE generated line. 1 +proc contents data=sasuser.iris; run;

NOTE: PROCEDURE CONTENTS used the following computer resources: Buffered IO: 36 Elapsed time: 0 00:00:00.23 Direct IO: 35 CPU time: 0 00:00:00.04 Page Faults: 47 ----------

Typically, you would construct more complicated SAS code based on your data.

Alternatives to CALL EXECUTE include writing code to a file and then %INCLUDE'ing that file, using the macro language, and using the INTO clause of PROC SQL; each approach has its own advantages and disadvantages.

-- JackHamilton@FirstHealth.com Development Manager, Technical Group METRICS Department, First Health West Sacramento, California USA

>>> "David F Bocobo" <David.Bocobo@BMS.COM> 07/07/2000 11:35 AM >>> Could someone please explain call execute to me. I've been searching through the SAS version 6 manuals and can't find it.

Thanks.

Dave Bocobo


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