Date: Wed, 9 Jul 2008 16:57:57 -0400
Reply-To: "Fehd, Ronald J. (CDC/CCHIS/NCPHI)" <rjf2@CDC.GOV>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Fehd, Ronald J. (CDC/CCHIS/NCPHI)" <rjf2@CDC.GOV>
Subject: Re: Are statements that are %INCLUDEd self aware.
In-Reply-To: <7367b4e20807091238n710e8d99s7d5408cf37e683cc@mail.gmail.com>
Content-Type: text/plain; charset=us-ascii
> From: data _null_,
> Subject: Re: Are statements that are %INCLUDEd self aware.
> Obviously:
sorry, I forgot the emoticon for tongue-in-cheeky :-o
give an example of what you think you want to do.
I don't see that you can write an algorithm
where this can happen.
you are either in the program before you include
or you are in the include
speaking of branching,
this paper shows a trick for conditional execution of includes
perhaps that's what you want.
SUGI 25: 2000 Indianapolis IN
App Dev 38 Writing for Reading SAS Style Sheet
The Writing for Reading SAS (r) Style Sheet:
Tricks, Traps & Tips from SAS-L's Macro Maven
http://tinyurl.com/4rug92 for:
http://www2.sas.com/proceedings/sugi25/25/ad/25p038.pdf
Ron Fehd the macro maven CDC Atlanta GA USA RJF2 at cdc dot gov
>
> What I would like is to detect if a code block is %INCLUDEd and branch
> accordingly. Might be useful for testing parametrized include files
> or other uses perhaps.
>
> On 7/9/08, Fehd, Ronald J. (CDC/CCHIS/NCPHI) <rjf2@cdc.gov> wrote:
> > > From: data _null_,
> >
> > > Don't know if my subject makes sense but...
> > >
> > > Is there a way to determine if the code that is executing
> was %INCed.
> > >
> > > Like a function perhaps.
> > >
> > > data _null_;
> > > rc = WasItIncluded();
> > > run;
> >
> > no, there is not a SAS function
> >
> > it is a user function: read the log!
> >
> > 11 %Include SiteIncl(split-into-subsets);
> > NOTE: %INCLUDE (level 1) file SITEINCL(split-into-subsets) is file
> > C:\Temp\sorting\sas\split-into-subsets.sas.
> >
> > options associated with includes: source2;
> >
> > proc options define value option=source2;run;
> >
> > Ron Fehd the %include maven
> > and macro maven CDC Atlanta GA USA RJF2 at cdc dot gov
> >
>
>