f



Re: Reusing code from SAS Program in another SAS Program #7 647546

Ian Whitlock wrote:

> %INC is neither a macro nor a macro instruction.  It is one of a
> few old SAS commands that begin with a %-sign and predate the
> current macro language.

%RUN and %LIST are two others; is that a complete list?

The MACRO statement is also not disabled by OPTIONS NOMACRO, but it doesn't
start with a percent sign.



--
Jack Hamilton
Oakland, California
0
jfh (1342)
5/24/2005 1:53:07 AM
comp.soft-sys.sas 142828 articles. 3 followers. Post Follow

0 Replies
815 Views

Similar Articles

[PageSpeed] 57

Reply:

Similar Artilces:

Re: Reusing code from SAS Program in another SAS Program #7 1547527
Hi Keith, is it exactly the same code (a) or only the same structure but with different variable names in it (b) ? (a) you may save the "IF code" in a separate member (let's say IFcode) and simply %INCLUDE that member within your various data stes. FILENAME xxx FILENAME xxx 'a.b.c.' DISP=shr; DATA ... SET ... %INCLUDE xxx(IFcode); run; (b) you could use the same technique but with macro logic in order to set the variable names dynamically before including IFcode does this help ? Regards Roland -----Original Message----- From: SA...

Re: Reusing code from SAS Program in another SAS Program
Keith - Store your code snippets in a PDS and then %include into your programs. For example this program includes a format called "$REGCRT" that I've stored in the PDS DSCHEER.PROD.RUN.FORMATS($REGCRT): //LOOKUP JOB (DSDBX0000T,DS80,20,5,0),'CHOATE 654-2160',TIME=1, // USER=DSPAULC,MSGCLASS=X,NOTIFY=DSPAULC //GOSAS EXEC HWSAS //SYSIN DD * OPTIONS PS=2000 LS=80; LIBNAME VENDOR 'DS.SYS.WORK.VENDOR.PANEL' DISP=SHR; FILENAME FMT 'DSCHEER.PROD.RUN.FORMATS' DISP=SHR; %INC FMT($REGCRT); DATA LOOKUP; RETAIN SENDDATE VENDRC RCNA...

Re: Reusing code from SAS Program in another SAS Program #4
In response to a question by Keith, Paul Choate suggested using %INC. The suggestion is reasonable, but not his explanation. Since %INC is a macro you can put it anywhere in open code and it will read the code snippet during compilation. %INC is neither a macro nor a macro instruction. It is one of a few old SAS commands that begin with a %-sign and predate the current macro language. This can be shown by a batch job run with the option NOMACRO. Here is the log. NOTE: SAS (r) Proprietary Software Release 8.2 (TS2M0) Licensed to The SAS Learning Edition V2.0, Site ...

Re: Reusing code from SAS Program in another SAS Program #5
Ian, I agree with your statement: "Well maybe it is best postponed to the time Keith shows that parameterization would be helpful to him." If it does turn out that parameterization would be helpful to him, he is in luck. I will agree to offer him, and SAS-L, the best example that my understanding of the SAS Component Language and my meager skills will allow. And I hope you, and as many other mmmm's as possible, will do likewise with the SAS Macro Language. I hope it has become apparent to you and other mmmm's that the SAS Component Language can handle whole classes of pr...

Re: Reusing code from SAS Program in another SAS Program #6 1547525
Keith, You have two choices: 1st.: create macros containing your if statements and store them either in a user or public macro library. 2nd.: Create text files contaiing your if statements save them in a PDS and %include them in your program. Toby Dunn From: Keith <kmccall00@CHARTER.NET> Reply-To: Keith <kmccall00@CHARTER.NET> To: SAS-L@LISTSERV.UGA.EDU Subject: Reusing code from SAS Program in another SAS Program Date: Fri, 20 May 2005 15:23:07 -0700 I write SAS programs on the Mainframe. I have several programming steps in multiple programs that use the same IF state...

Re: Reusing code from SAS Program in another SAS Program #6 647520
Thanks for the clarification Ian - =20 That's why I love SAS-L so much. :) This is the second new-to-me thing = this morning. =20 http://support.sas.com/onlinedoc/913/getDoc/en/lrdict.hlp/a000214504.htm= <sasdoc> Rules for Using %INCLUDE You can specify any number of sources in a %INCLUDE statement, and you = can mix the types of included sources. Note, however, that although it is possible to include information from multiple sources in one %INCLUDE statement, it might be easier to understand a program that uses = separately coded %INCLUDE statements for each source. The %INCLUD...

Reusing code from SAS Program in another SAS Program
I write SAS programs on the Mainframe. I have several programming steps in multiple programs that use the same IF statements, for example. Maintenance is getting to be a problem because I may have to make the same code change in 50 different programs. I would like to write the If statement only once and read it into the appropriate data steps of the various programs. If someone could give me help on how I could do this, it would be appreciated. Keith - Store your code snippets in a PDS and then %include into your programs. For example this program includes a format called "$REGCRT...

Re: Can a SAS program call another SAS program
> From: David Fickbohm > I am writing a report that counts the number of widgets produced by > partners. I have a small routine that finds the partners id > number and > name. Obviously I could copy this code into my program and > execute it. I was wondering if there was a more elegant way > of "Calling" a SAS program > from within a SAS program. > I am running SAS 8.1 in windows. still!?!? surely that is a typo: 9.1? i.e.: -The- 9.1==9.1.3 include it: - - - subRoutineX.sas - - - *...; - - - subRoutineX.sas end - - - - - - autoexec.sas - - - filen...

Re: Can a SAS program call another SAS program #4
> From: Michael Raithel > David Fickbohm posted the following: > > I am writing a report that counts the number of widgets produced by > > partners. I have a small routine that finds the partners id > > number and > > name. Obviously I could copy this code into my program and execute > > it. I was wondering if there was a more elegant way of "Calling" a > > SAS program > > from within a SAS program. I am running SAS 8.1 in windows. > > > > David, there sure is a more elegant way; and a simple one at > that! Simply ...

Re: Can a SAS program call another SAS program #3
Dear SAS-L-ers, David Fickbohm posted the following: > I am writing a report that counts the number of widgets produced by > partners. I have a small routine that finds the partners id > number and > name. Obviously I could copy this code into my program and > execute it. I was wondering if there was a more elegant way > of "Calling" a SAS program > from within a SAS program. I am running SAS 8.1 in windows. > David, there sure is a more elegant way; and a simple one at that! Simply use the %INCLUDE statement. The %INCLUDE statement allows you to in...

Re: Can a SAS program call another SAS program #2
Dave, What you want to do can be done with %include. Bob Abelson HGSI 240 314 4400 x1374 bob_abelson@hgsi.com David Fickbohm <DavidF@HOMEGAIN.COM> Sent by: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> 10/15/2004 04:05 PM Please respond to David Fickbohm To: SAS-L@LISTSERV.UGA.EDU cc: Subject: Can a SAS program call another SAS program People, I am writing a report that counts the number of widgets produced by partners. I have a small routine that finds the partners id number and name. Obviously I could copy this code into my...

Re: Possible to run a SAS program within another SAS program?
Julie, Uhhh create a macro that simply %includes the programs you want and in what order. It would be very specific to you the creator and user, in other words right biw I can't think of a good way to pass al the info you need to the macro from the user. As you can tell the user interface would be the crucial part of this. I personally wouldnt want to have this in my production code but have written SAS programs that do nothing more than %include a list of programs. Toby Dunn From: oseithedude@GMAIL.COM Reply-To: oseithedude@GMAIL.COM To: SAS-L@LISTSERV.UGA.EDU Subject: Possibl...

Re: Possible to run a SAS program within another SAS program? #4
Julie, Simple answer. Store programs in one directory, say C:\sasprogs. filename pgm "c:\sasprogs" ; %inc pgm (prog1, prog3, ... ) ; Ian Whitlock =============== Date: Wed, 7 Dec 2005 11:28:43 -0800 Reply-To: oseithedude@GMAIL.COM Sender: "SAS(r) Discussion" From: oseithedude@GMAIL.COM Organization: http://groups.google.com Subject: Possible to run a SAS program within another SAS program? Comments: To: sas-l Content-Type: text/plain; charset="iso-8859-1" Hello, I have 9 SAS programs, all within the same Windows folder th...

Re: Possible to run a SAS program within another SAS program? #2
Dear SAS-L-ers, Julie posted the following: > Hello, I have 9 SAS programs, all within the same Windows > folder that I usually run at the same time - one right after > the other. For convenience, is it possible to write a simple > SAS program that will let me run all the programs at once or > to have a program that will allow me to pick and choose which > SAS programs I want to run (e.g., in the case I only want to > run the first 3 and last program out of the 9 SAS > programs) and which order the programs are run in? I guess > what I'm really looking for is i...

Web resources about - Re: Reusing code from SAS Program in another SAS Program #7 647546 - comp.soft-sys.sas

Wikipedia:Reusing Wikipedia content - Wikipedia, the free encyclopedia
There are many reusers of Wikipedia's content, and more are welcome. If you want to use Wikipedia's text materials in your own books/articles/web ...

Andrea Reusing (@andreareusing) on Twitter
Sign in Sign up To bring you Twitter, we and our partners use cookies on our and other websites. Cookies help personalize Twitter content, tailor ...

YouTube - Reusing Soda Can Tabs Closet Organizer Double Hanger
You are using an outdated browser, which YouTube no longer supports. Since some features on YouTube may not work, you are viewing a lightweight ...

The grey area of freelancers reusing their own work
Write more for less pay. In the content-hungry online media industry, there is a temptation for freelancers to reuse their own writing, research ...

Stop Reusing Your Old Exams, You LAZY Law School Professors!
How hard is it to write an exam for a course you've taught all semester? On a scale of one to ten ten involving programing a rocket ship, one ...

Reusing Baby Food Jars
Reusing glass baby food jars isn't a new idea. The chubby pots make for great containers for all manner of items - craft and sewing supplies, ...

Daimler is reusing electric vehicle batteries to store renewable energy
The company says its stationary storage unit will come online in early 2016.

Rod Stewart Sued for Reusing Image of the Back of His Head
Celebrity photographer Bonnie Schiffman has filed a copyright lawsuit that claims

Three infections linked to Colorado dentist accused or reusing needles for over 11 years
... practice (CBS News) Three possible infections have been linked to embattled Colorado oral surgeon Dr. Stephen Stein, the man accused of reusing ...

Movie Studios Sued For Reusing Lesser Known Parts Of Famous Soundtracks
It’s going to be tough to prove. But if it goes through, this could lead to changes to the way that music is made – and used – in our movies ...

Resources last updated: 2/6/2016 3:15:45 AM