| Date: | Fri, 7 Apr 2006 19:25:55 +1200 |
| Reply-To: | Robin Templer <robin.templer@XTRA.CO.NZ> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Robin Templer <robin.templer@XTRA.CO.NZ> |
| Subject: | Re: ODS filename to be same as sas program |
|
| In-Reply-To: | <1144373370.499619.145410@g10g2000cwb.googlegroups.com> |
| Content-Type: | text/plain; charset=ISO-8859-1; format=flowed |
Assuming you are running windows - note that this WILL NOT work on other
envoirnments
Data _null_ ;
fname="%sysget(SAS_EXECFILEPATH)" ;
ext=scan(fname,-1,'.') ;
Length Lname $200 ;
length=length(fname)-(length(ext)+1);
If length > 0 then lname=substr(fname,1,length) ;
Else lname='__Untitled__' ;
Call Symput('PNAME',lname) ;
Run ;
footnote1 j=l h=1 "Programme Name: %trim(&PNAME).sas" ;
ods listing close ;
ods noproctitle ;
ods rtf file="%trim(&PNAME).rtf"
/** Other ODS options **/
;
/*-- Your Proc Statements Here --*/
Ods _ALL_ Close;
kaushik.manas@GMAIL.COM wrote:
>Hi,
>
>I am using ods to make an output file. However, I would like the output
>file to have the same name as sas program used to create it. Since I
>make multiple copies of the program, it would be great if this thing
>can be done dynamically without me having to change the ods filename
>each time.
>
>Is there anyway this can be done in SAS?
>
>thanks
>
>
>
>
--
============================================================
Robin & Charmaine Templer
Wellington, New Zealand
Email: robin.templer@xtra.co.nZ
FAX : 64-4-476-4299
Phone: 64-4-476-4299
|