f



Re: Running a SAS program within a SAS program #2

Kathleen

Based on your subject, my immediate impulse was %inlude()   where you put a
fileref in the quotes. However, I think you want to do something else. You
say that you have individual programs that produce a set for each year. Do
you store these sets somewhere or do you run the programs when you want
data for a given year. I would suggest that you first get a collection of
these yearly sets and run a contents on each one. Then, write a program
similar to

Data mylib.combined;

set

mylib.year1(rename = (Dates = Date ....))
mylib.year2(rename= (Sdates=Date....))
.....

;

The idea would be to get rid of the variations in the variable names. You
could simply copy in the individual programs into one honking big program
and keep running this until you get a uniform combined set but you will use
a lot of machine cycles doing this. Assuming that you have to make several
passes at the data in order to get things right, I would work from stored
data sets where all you are doing is changing the rename statements.

Good luck


Nat Wooding
Environmental Specialist III
Dominion, Environmental Biology
4111 Castlewood Rd
Richmond, VA 23234
Phone:804-271-5313, Fax: 804-271-2977



             Kathleen Santos
             <flowerpotcat@GMA
             IL.COM>                                                    To
             Sent by: "SAS(r)          SAS-L@LISTSERV.UGA.EDU
             Discussion"                                                cc
             <SAS-L@LISTSERV.U
             GA.EDU>                                               Subject
                                       Running a SAS program within a SAS
                                       program
             04/21/2008 12:55
             PM


             Please respond to
              Kathleen Santos
             <flowerpotcat@GMA
                  IL.COM>






  Hello,

I would like to combine multi years of data into one. Each year has a
particular data set and a particular program to create a SAS dataset.
However, not all programs are the same (e.g. variable names may change
throughout the years).

What I would like to do is to create one program that would call on the
other programs to create SAS datasets. Then I'll integrate them together
and
do whatever I it is I need to do.

I hope someone can help me.

Thanks.

Kathleen


-----------------------------------------
CONFIDENTIALITY NOTICE:  This electronic message contains
information which may be legally confidential and/or privileged and
does not in any case represent a firm ENERGY COMMODITY bid or offer
relating thereto which binds the sender without an additional
express written confirmation to that effect.  The information is
intended solely for the individual or entity named above and access
by anyone else is unauthorized.  If you are not the intended
recipient, any disclosure,  copying, distribution, or use of the
contents of this information is prohibited and may be unlawful.  If
you have received this electronic  transmission in error, please
reply immediately to the sender that you have received the message
in error, and delete it.  Thank you.
0
4/21/2008 5:39:28 PM
comp.soft-sys.sas 142828 articles. 3 followers. Post Follow

0 Replies
981 Views

Similar Articles

[PageSpeed] 24

Reply:

Similar Artilces:

Re: Running SAS programs from within a SAS program #2
Or better when programs are in one directory file code "drive:\your_folder\" ; %inc code ( prog1 prog2 prog3 ... ) ; Then the next step is parameter driven macros in an autocall library. %prog1(parm1=...) %prog2(alpha=...) ..... Ian Whitlock ================= Date: Fri, 18 Nov 2005 22:54:54 -0500 Reply-To: mah-j@statworks.com Sender: "SAS(r) Discussion" From: "mah-j@statworks.com" <msoobader@VERIZON.NET> Subject: Re: Running SAS programs from within a SAS program...

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...

Re: Running a SAS program within a SAS program
%include() On Mon, Apr 21, 2008 at 12:55 PM, Kathleen Santos <flowerpotcat@gmail.com> wrote: > Hello, > > I would like to combine multi years of data into one. Each year has a > particular data set and a particular program to create a SAS dataset. > However, not all programs are the same (e.g. variable names may change > throughout the years). > > What I would like to do is to create one program that would call on the > other programs to create SAS datasets. Then I'll integrate them together and > do whatever I it is I need to do. > > I ...

Re: Running SAS programs from within a SAS program
Keith, You can use a series of %include statements naming the programs in the order you want to call them in. %include "drive:\your_folder\program name.txt" ; Mah-J M. Soobader, PhD Principal consultant STATWORKS www.statworks.com -----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU]On Behalf Of Keith W. Larson Sent: Friday, November 18, 2005 10:32 PM To: SAS-L@LISTSERV.UGA.EDU Subject: Running SAS programs from within a SAS program Dear All, I have several small(ish) SAS programs that convert and format DBF files. Thanks to all who helped solve...

Re: Running a SAS program within a SAS program #3
Kathleen, You can use %INCLUDE in a SAS program to call other SAS programs. Jack Clark Research Analyst Center for Health Program Development and Management University of Maryland, Baltimore County -----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Kathleen Santos Sent: Monday, April 21, 2008 12:55 PM To: SAS-L@LISTSERV.UGA.EDU Subject: Running a SAS program within a SAS program Hello, I would like to combine multi years of data into one. Each year has a particular data set and a particular program to create a SAS dataset. However, not all p...

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...

Running SAS programs from within a SAS program
Dear All, I have several small(ish) SAS programs that convert and format DBF files. Thanks to all who helped solve formatting problems. I would like to create a master SAS program that calls each one in sequence. Any ideas? Cheers, Keith __________________________________ Yahoo! FareChase: Search multiple travel sites in one click. http://farechase.yahoo.com Keith, You can use a series of %include statements naming the programs in the order you want to call them in. %include "drive:\your_folder\program name.txt" ; Mah-J M. Soobader, PhD Principal consultant STATWORKS www.s...

Running a SAS program within a SAS program
Hello, I would like to combine multi years of data into one. Each year has a particular data set and a particular program to create a SAS dataset. However, not all programs are the same (e.g. variable names may change throughout the years). What I would like to do is to create one program that would call on the other programs to create SAS datasets. Then I'll integrate them together and do whatever I it is I need to do. I hope someone can help me. Thanks. Kathleen ...

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? #6
On Wed, 7 Dec 2005 22:32:49 -0800, oseithedude@GMAIL.COM wrote: >nevin.krishna@gmail.com wrote: >> You could use the %include statement to call a specified program. >> for example : >> >> %include "c:\documents and settings\nkrishna\my >> documents\macros\upcase_mac.sas"; >> >> where upcase_mac.sas is a program stored in the above path..so you >> could write an include statement for each program and then copy and >> paste them into any order you need..unless of course i am >> misunderstanding your needs..:-) >> >...

Re: Possible to run a SAS program within another SAS program? #5
Subject: Re: Possible to run a SAS program within another SAS program? Summary: Simple introduction to macro and design issues in the context of multiple programs producing data with a version indicator Respondent: Ian Whitlock iw1junk@comcast.net Julie, It looks like you are ready to think about program design with a little macro. As you present it, the keys ideas are 1) set of multiply related programs sometimes run as a set and sometimes only a subset 2) some programs produce data set with version indicator Your basic set up indicates that you are thinking of each...

Re: Possible to run a SAS program within another SAS program? #3
why just last week, we discussed this: Date: Mon, 21 Nov 2005 11:01:30 -0500 Subject: Re: Running SAS programs from within a SAS program http://www.listserv.uga.edu/cgi-bin/wa?A2=ind0511C&L=sas-l&P=R33664 Ron Fehd the %include maven CDC Atlanta GA USA RJF2 at cdc dot gov > -----Original Message----- > From: osei the dude > 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 ...

Possible to run a SAS program within another SAS program?
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 if there is a way to call another SAS program using only a couple lines of code so that, if ...

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: run a SAS program before SAS session starts #2
Masoud; That's what autoexec.sas is for. Look it up in the documentation. Ed Edward Heaton, Senior Systems Analyst, Westat (An Employee-Owned Research Corporation), 1650 Research Boulevard, TB-286, Rockville, MD 20850-3195 Voice: (301) 610-4818 Fax: (301) 294-2085 mailto:EdHeaton@Westat.com http://www.Westat.com -----Original Message----- From: owner-sas-l@listserv.uga.edu [mailto:owner-sas-l@listserv.uga.edu] On Behalf Of mpajoh@ODOT.ORG Sent: Tuesday, November 27, 2007 4:17 PM To: SAS-L@LISTSERV.UGA.EDU Subject: run a SAS program before SAS session starts...

Run a sas program in another sas program
Dear SAS Servlisters: I am a Stata user, and am trying to learn SAS too. In Stata, in a syntax file, I can write something: do dofile1.do do dofile2.do do dofile3.do Then it will invoke dofile1-dofile3 and run the contents in these do files. So that if I have a series of consecutive data management and analysis jobs in different do files, I can execute them by running one file that contains a series of do commands without having to open those files and run them one by one. This is critical when I don't want to mess up my analysis with data management; that is, I'd like to put syntax...

Re: SAS Advanced Programming Exam for SAS 9: SAS Joke of the year. #2
jontugman, Test preparation is akin to following a simple algorithm: 1. Evaluate the test and discover if it is worth taking. 2. If #1 evaluates false then go to exit. 3. Determine if your *test* knowledge of SAS is insufficient. 4. If #3 evaluates true, do the test preparation. 5. Pay the money. 6. Take the test. 7 Exit. From your standpoint, the step of paramount importance is step #1. That is where you mainly failed. From SAS' standpoint, only one step matters: #5. This is the only reason the test was created in the first place. The world would be a better place if all employers un...

How to run several SAS programs in one sas Program
Hi, Is it possible to run several SAS programs in one sas Program. I can use the %INCLUDE, but is there another way? Tx On Mar 18, 5:31=A0am, laika <michel.verhe...@axa.be> wrote: > Hi, > > Is it possible to run several SAS programs in one sas Program. I can > use the %INCLUDE, but is there another way? > > Tx If you want to read each program as a separate batch program you can use SYSTASK. systask (or %systask) is a good option. If you want to run several programs on different machines (local or remote) then "rsubmit" could be of use:...

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: 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: run a SAS program before SAS session starts
> From: mpajoh@ODOT.ORG > How can I run a SAS program every time before the interactive session > starts? > > Masoud > > I use SAS 9.1.1.3 on XP. Here are the files you need to make a batch file which executes some sas program then opens sas: http://www.sascommunity.org/wiki/Batch_processing_under_Windows - - - StartOneThenSAS.bat - - - call sas MyProgram1 call sas Ron Fehd the macro maven CDC Atlanta GA USA RJF2 at cdc dot gov ...

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 #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: 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 ...

Web resources about - Re: Running a SAS program within a SAS program #2 - comp.soft-sys.sas

Running - Wikipedia, the free encyclopedia
This article is about the type of locomotion in humans. For running in horses, see Horse gait . For locomotion in dogs, see Gait (dog) . For ...

Broken neck no barrier to running for gutsy first-time marathoner
Thirty-two-year-old raises raised the bar for herself and will complete her first marathon at the Australian Running Festival.

Running safety top of mind for coach
... a sexual assault in Burnaby Thursday afternoon sent a woman to hospital, Burnaby RCMP issued a warning to women who are out jogging or running ...

Neel Kashkari Feeling The Bern On First Day Running Minneapolis Fed
It's a bad scene at the Goldman Sachs alumni club.

Time's Running Out for Ad Age Digital Conference Early-Bird Registration
How are the best brands and smartest marketers coping with the seismic, digitally-driven changes rocking advertising? How are industry innovators ...

Mind Spiders go "Running" with new single (listen), playing Dirtnap Records SXSW showcase w/ Radioactivity ...
... TX's Mind Spiders are set to release their new album Prothesis on March 12 via Dirtnap and they've just dropped a new track from it, "Running." ...

REPORT: £1.8 billion tech company Powa is lining up administrators after running out of cash
... that Powa, which makes a mobile app that lets you buy things with your phones camera, had "significant doubts" about its future after running ...

Batman V. Superman Running Time Confirmed
Batman V Superman: Dawn of Justice will run for more than two and a half hours, AMC Theatres has [...]

Open thread for night owls: For Republicans wanting to stop Trump, time is running out
While the Republican Party frets over how to stop Donald Trump, time is running out . With the Republican field so divided after New Hampshire, ...

Report: Former Cowboys Running Back Joseph Randle Arrested And Charged With Battery
According to a report from TMZ Sports , which was later corroborated by the Dallas Morning News , former Cowboys running back Jospeh Randle was ...

Resources last updated: 2/22/2016 11:06:10 PM