Date: Tue, 2 Nov 2004 20:33:40 +1300
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: print filename in footnote?
In-Reply-To: <200411011607.iA1G7DhZ022522@listserv.cc.uga.edu>
Content-Type: text/plain; charset=us-ascii; format=flowed
Heres a V9 Macro I use for exactly this purpose. It creates the PNAME
macro varioable which I also use for the ODS FILE= parameter in the HTML
/PDF/RTF destinations. I have found it extremely useful
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" ;
Howard Schreier wrote:
>This question came up during the open Q&A period at the most recent meeting
>of the Washington DC SAS Users Group. Our guest speaker, Frank DiIorio,
>suggested the following SQL statement
>
> select XPath
> into :CurrFile separated by ' '
> from dictionary.extfiles
> where fileref like "#LN00006"
> ;
>
>See Frank's paper "SIMPLICITY THROUGH OBSCURITY: SOME TIPS TO SIMPLIFY YOUR
>PROGRAMMING LIFE" for details and qualifications.
>
> http://www.codecraftersinc.com/pdf/SimplicityThroughObscurity.pdf
>
>On Fri, 22 Oct 2004 15:48:07 -0400, DePuy, Venita <depuy001@DCRI.DUKE.EDU>
>wrote:
>
>
>
>>Hi all -
>>Hopefully a quick question for friday afternoon -
>>is there a macro variable with the file name in it?
>>
>>I'm wanting to add a footnote statement at the top of all my programs -
>>"&sysdate by &sysuserid from FILENAME"; so it automatically prints the date
>>run, who ran it, and what file it was from on the output.
>>
>>But couldn't find such a variable in the list of global macro variables . .
>>
>>Thanks!
>>-Venita
>>Venita DePuy
>>Statistician II, Center for Clinical and Genetic Economics
>>Duke Clinical Research Institute
>>(919) 668-8087
>>venita.depuy@duke.edu
>>
>>
>
>
>
--
============================================================
Robin & Charmaine Templer
Wellington, New Zealand
Email: robin.templer@xtra.co.nZ
FAX : 64-4-476-4299
Phone: 64-4-476-4299
|