Date: Thu, 15 Mar 2012 16:32:35 +0000
Reply-To: toby dunn <tobydunn@HOTMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: toby dunn <tobydunn@HOTMAIL.COM>
Subject: Re: Programatically determine the number of the last currently
used footnote
In-Reply-To: <CALJjakFpxuXWQ3x201tTARX+fBqp__1igp=GMOhA6Afg2N2A8g@mail.gmail.com>
Content-Type: text/plain; charset="Windows-1252"
%macro gettnfnum( Type = ) ;
/******************************************************************/
/** Macro Name : GetTnFNum **/
/** **/
/** Purpose : To Get The Title Or FootNote Number **/
/** **/
/** Parameters : Type ~ Specifies Whether To Grab The Next **/
/** Title Or FootNote Number. **/
/** **/
/** Valid Values Are: Title **/
/** FootNote **/
/** **/
/** Macro Type : Function Style **/
/** **/
/** Create By : Toby Dunn **/
/******************************************************************/
%Local DSID NumOfObs Sub RC ;
%If ( %Upcase( &Type ) = TITLE ) %Then %Do ;
%Let Sub = T ;
%End ;
%Else %If ( %Upcase( &Type ) = FOOTNOTE ) %Then %Do ;
%Let Sub = F ;
%End ;
%Let DSID = %SysFunc( Open( SASHELP.VTITLE ( Where = ( TYPE = "&Sub" ) ) ) ) ;
%Let NumOfObs = %SysFunc( Attrn( &DSID , NLOBSF ) ) ;
%Let RC = %SysFunc( Close( &DSID ) ) ;
&NumOfObs
%mend gettnfnum ;
Toby Dunn
If you get thrown from a horse, you have to get up and get back on, unless you landed on a cactus; then you have to roll around and scream in pain.
“Any idiot can face a crisis—it’s day to day living that wears you out”
~ Anton Chekhov
> Date: Thu, 15 Mar 2012 17:23:21 +0100
> From: js8765@GOOGLEMAIL.COM
> Subject: Re: Programatically determine the number of the last currently used footnote
> To: SAS-L@LISTSERV.UGA.EDU
>
> Hi again,
>
> I just found a solution to my question.
>
> proc sql noprint;
> select count(type) into :lst_ftnote
> from sashelp.vtitle
> where type = "F";
> quit;
>
> Thanks anyways,
>
> js
>
> On Thu, Mar 15, 2012 at 5:17 PM, js8765 <js8765@googlemail.com> wrote:
> > Hi all,
> >
> > I was wondering if anyone knows of a way to return the footnote number
> > of the last filled footnote.
> >
> > For example, if somewhere in the program the following statements are
> > dynamically created...
> >
> > FOOTNOTE1 this is the first;
> > FOOTNOTE2 this is the second;
> >
> > then later on in the program I would like to able to see that the
> > next footnote number available is '3'. Is this possible?
> >
> > Thanks for any advice,
> >
> > js
|