|Date: ||Wed, 6 Mar 1996 14:10:00 EST|
|Reply-To: ||"Gyzen, Rudy" <RGyzen@NITGNPSD.TELECOM.COM.AU>|
|Sender: ||"SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>|
|From: ||"Gyzen, Rudy" <RGyzen@NITGNPSD.TELECOM.COM.AU>|
|Subject: ||Re: Using Parameter in PROC SQL|
Others may have better suggestions, however here is a solution for you. The
sysparm invocation option lets you pass params into sas. You may retrieve
them using the sysparm() function or the &sysparm macro variable from within
SAS. The -log & -print switches redirect log & output to files. There are
other switches you can use to accomplish this (ALTLOG, ALTPRINT, SYSPRINT).
You can also specify a FILENAME statement from within your SAS program to
accomplish the redirection of output to a file. A lot of this is detailed
in the SAS companion for the Unix Environment.
# Script to run sas_pgm.sas (hacked from someone else's script - accolades
# shall be passed on!)
/home/sas/sas609/sas -sysin /saspgm/sas_pgm.sas \
-config /common/scripts/config.sas609 \
-log /log/$log \
-print /output/$output \
-sysparm "$date" \
-memsize 128M \
(Contract) Snr Analyst Programmer
Olympicity, Australia "Hindsight knows everything"
>To: Multiple recipients of list SAS-L
>Subject: Using Parameter in PROC SQL
>Date: Tuesday, 5 March 1996 2:09PM
>I'm new to SAS/UNIX. How can I do the following:
>1. run a sas program as part of a UNIX script
>2. pass a parameter to the sas program to use in a PROC SQL/select
> as in:
> select fld1, fld2, fld3 from tbl1 where dat1 = parameter-date
>3. save my output to an external file.
>What I am trying to do is run my sas program in batch, scheduled mode
>Thanks in advance for your help.