Go Back   Rhinocerus > Newsgroup > Newsgroup comp.soft-sys.sas

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 05-13-2005, 06:01 AM
Joe Whitehurst
Guest
 
Posts: n/a
Default Re: SCL newbie question

Excellent! Ian, Richard's thoroughness ought to satisfy even your high
standards. In the future, instead of cluttering up my lean, mean, clean SAS
Component Language functionally equivalent programs with extraneous and
unnecessary, for pedagogical purposes, parameter passing code, I will just
cite Richard's post so we all understand what has been omitted for the sake
of simplicity.

Joe
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Richard
A. DeVenezia
Sent: Friday, May 13, 2005 1:22 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Re: SCL newbie question

Randy Herbison wrote:

Amongst many other excellent things

> SCL entry. In any case, you must compile SCL entries in interactive
> mode. Although PROC BUILD has a BATCH option, it cannot be used to
> batch compile.


The docs state:
"You cannot build individual entries in batch mode, but it is a convenient
way to execute PRINT, COMPILE, MERGE, MLINK, and SYNC statements when you do
not need to view the catalog or catalog entry. "

This means you cannot (headlessly and programmatically, from base) create a
new SCL entry in a catalog. However, if an existing known SCL entry
contains a %INCLUDE, the the source of the included file _can_ be compiled
programmatically in batch.

For example:

Suppose you have an uncompiled SCL entry created using an interactive build
session

command:BUILD sasuser.batch.dynamite.scl
---- type in ----
%include dynamite;
---- type in ----
command: END

And suppose you have this sas program

---- c:\temp\dynamite.sas ----
filename dynamite catalog 'work.dynamite.sclcode.source';

data _null_;
input;
file dynamite;
put _infile_;
cards4;
init:
put "Dynamically generated scl -- is dynamite?";
return;
;;;;
run;

* compile dynamite.scl which includes scl source pointed to by fileref
dyamite;
proc build batch catalog=sasuser.batch;
compile select=dynamite.scl;
run;

dm 'af c=sasuser.batch.dynamite.scl';
---- c:\temp\dynascl.sas ----

And finally, you have this SAS session invocation

$ sas.exe -noterminal -batch -sysin c:\temp\dynascl.sas

You will see that the contents on fileref DYNAMITE are dynamically created,
compiled (by way static scl entry) and run (again by way of static scl entry
point)

Of course, you need SAS/AF licensed in order to compile SCL. You need only
Base SAS to run SCL that has been previously compiled for you.

> Compiled SCL entries can be run in batch mode by using either the AF
> or AFA commands or PROC DISPLAY. The AF and AFA commands offer the
> advantage of allowing you to pass parameters to an SCL entry without
> using macro. Parameters are specified as name/value pairs. The DM
> statement below could be a .sas file submitted to SAS in batch.
>
> dm "af c=<libname>.<catalog>.<member>.scl table=sashelp.class
> column=age";


Surprisingly this works; typically display manager commands are disallowed
when running in batch mode. I suppose since the invocation is 'headless'
there is nothing for te viewing subsystem to complain about. If the scl
entry would cause an attempt to create a window, then batch mode invocation
would complain. (The same type of error you see in Enterprise Guide when
you have a code block that is trying to proc display a frame entry)

--
Richard A. DeVenezia -- Learn how to customize SAS Explorer
http://www.devenezia.com/downloads/sas/actions/
Reply With Quote
Alt Today
Advertising
 
and become member of Rhinocerus
Standard Sponsored Links

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: NewBie Question - array's and using the index function Joe Matise Newsgroup comp.soft-sys.sas 0 10-23-2008 07:59 PM
Re: NewBie Question - array's and using the index function Jack Clark Newsgroup comp.soft-sys.sas 0 10-23-2008 06:11 PM
Re: Newbie Question: Calculate differences between observations data _null_; Newsgroup comp.soft-sys.sas 0 04-11-2007 02:50 PM
Newbie Question: Calculate differences between observations in on Frank Mwaniki Newsgroup comp.soft-sys.sas 0 04-11-2007 12:09 PM
Re: Newbie Question: Calculate differences between observations Huang, JS Newsgroup comp.soft-sys.sas 0 04-11-2007 12:00 PM



All times are GMT. The time now is 08:19 AM.


Copyright ©2009

LinkBacks Enabled by vBSEO 3.3.0 RC2 © 2009, Crawlability, Inc.