f



data programming problem

Hi,

I have a challenging data programming problem that I can’t wrap my head
around.

I have a daily exposure data for 10 years (woodsmoke presence is 1/0 or
missing) and I have an individual exposure file with individual IDs, period
(s) of exposure (start/end) and weather or not the person was in an area
with woodsmoke exposure:


                                                          DATE        WOOD


                                                    01/01/1994        0
                                                    01/02/1994        0
                                                    01/03/1994        1
                                                    01/04/1994        0
                                                    01/05/1994        1
                                                    01/06/1994        1
                                                    01/07/1994        1
                                                    01/08/1994        1
                                                    01/09/1994        0
                                                    01/10/1994        1
                                                    01/11/1994        0
                                                    01/12/1994        0
                                                    01/13/1994        0
                                                    01/14/1994        0
                                                    01/15/1994        0
                                                    01/16/1994        0
                                                    01/17/1994        0
                                                    01/18/1994        1
                                                    01/19/1994        1
                                                    01/20/1994        1
                                                    01/21/1994        0
                                                    01/22/1994        0
                                                    01/23/1994        0
                                                    01/24/1994        0
                                                    01/25/1994        0
                                                    01/26/1994        0
                                                    01/27/1994        0
                                                    01/28/1994        1
                                                    01/29/1994        1
                                                    01/30/1994        1
                                                    01/31/1994        1
          .
          12/31/2003       0

STUDYID         START        END                EXP

0000000001    04/01/1991    05/03/2002            0
0000000001    05/04/2002    03/10/2003            1
0000000002    04/01/1991    01/27/2003            1
0000000003    04/01/1992    11/09/1996            0
0000000003    11/10/1996    10/28/1997            0
0000000003    10/29/1997    03/14/2003            0
0000000004    04/01/1991    06/29/1998            0
0000000004    06/30/1998    12/27/2002            0
0000000005    12/01/1993    04/01/1999            0
0000000006    10/01/1992    04/01/2002            0
..

I need to create a file that has one row per individual and has 120
variables corresponding to the number of month intervals that are in the
10 years of exposure data in first file. It can be seen from the second
file that an individual was not necessarily followed for the same amount
of time as the exposure data was available and also an individual. For
instance, for the first individual who spent part of the time in an area
without potential for woodsmoke exposure (until May 3, 2002) and the rest
of the time in an area with potential for woodsmoke exposure, the first
three exposure variables would be missing, because the person has no data
btw 1JAN1994 and 31MAR1994, and then for the fourth variable (representing
the fourth month in the array of 120 months) the value would be equal with
the sum of days with wood exposure from the first file. For the first
individual, since the first time when was in the study is 04/01/1991, the
sum for the total number of exposure days for april would be 12, not
counting the 1 day  with woodsmoke in the first part of the interval.

STUDYID  W1 W2 W3 W4 W5 W6 . . . . . . W120
0000000001 . . . 12



I am not sure if I am clear enough (I hope I am) but I would apreciate any
help.

Cheers,

Cornel
0
clencar (85)
3/8/2008 2:18:59 AM
comp.soft-sys.sas 142828 articles. 3 followers. Post Follow

0 Replies
464 Views

Similar Articles

[PageSpeed] 38

Reply:

Similar Artilces:

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

SAS/Warehouse Administrator Problem?? or SAS/ACCESS problem??
hello, I've built a process in SAS/Warehouse Administrator, where i'm trying to extract distinct cities from the 3 tables(source schema) in Oracle into a new table (target schema) called CITY and again into UniqueCity (target schema) bcos of some redundancy. The process looks like this. Unique City | | mapping | | CITY ...

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

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: 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 hope someone can help me. > > Thanks. > > Kathleen > -- =============================== WenSui Liu ChoicePoint Precision Marketing Phone: 678-893-9457 Email : wensui.liu@choicepoint.com Blog : statcompute.spaces.live.com =============================== ...

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

Need SAS Data Integration Consultant with SAS Data Integration Studio, Base SAS, SAS macros and SQL experience for a 9 months project at Charlotte NC, please send resumes to kamesh@kmmtechnologies.com
Need SAS Data Integration Consultant with SAS Data Integration Studio, Base SAS, SAS macros and SQL experience for a 9 months project at Charlotte NC, please send resumes to kamesh@kmmtechnologies.com ...

SAS programming question/problem
Hello, I have a SAS (V8.2) data set with, say, 5 fields (in my data set it has like 500 fields) called VAR1, VAR2,..., VAR5. I have an Excel data set that looks like this: A B VAR1 Age VAR2 Income VAR3 Gender VAR4 Num_Accts VAR5 Zip_Code I need to go to my SAS data set above and replace the field names VAR1,...,VAR5 with Age, Income, Gender, Num_Accts, Zip_Code respectively. (A and B are the column headings in Excel sheet, not of importance, I guess.) Someone asked me why I need this. I need this for modeling. People need to know what VAR1, VAR2, VAR3, etc. mean. ...

problem scheduling SAS programs
Hello All, I am tyring to schedule a SAS program to run automatically on a periodic basis (daily), and am encountering problems. I am using microsoft XP, and SAS verion 8.2. To schedule the sas program i have been using the "schedule task" wizard found in system tools. If i save my SAS program that i wish to run as "autoexec.sas" and place it in the sas startup folder, the scheduler runs fine. However, I then have the problem of the program running everytime i open sas to write another program or run another program. (The program i want to run on the scheduler has a long p...

Re: data programming problem
Cornel Lencar wrote: > Hi, > > I have a challenging data programming problem that I can't wrap my > head around. > > I have a daily exposure data for 10 years (woodsmoke presence is 1/0 > or missing) and I have an individual exposure file with individual > IDs, period (s) of exposure (start/end) and weather or not the person > was in an area with woodsmoke exposure: > > > DATE > WOOD > > > 01/01/1994 > 0 01/02/1994 > 0 01/03/1994 > 1 01/04/1994 > 0 01/05/1994 > 1 01/06/1994 > 1 01/07/1994 > 1 01/08/1994 > 1 01/09/1994 > 0 01/10/1994 > 1 01/11/1994 > 0 01/12/1994 > 0 01/13/1994 > 0 01/14/1994 > ...

SAS/Warehouse Administrator Problem?? or SAS/ACCESS problem?? #2
hello, I've built a process in SAS/Warehouse Administrator, where i'm trying to extract distinct cities from the 3 tables(source schema) in Oracle into a new table (target schema) called CITY and again into UniqueCity (target schema) bcos of some redundancy. The process looks like this. Unique City | | mapping | | CITY ...

Searching for SAS Programming Tips: A Guide to Efficient SAS Programming
Hi, I have 9.1.3 SAS help lists a particular reference "SAS Programming Tips: A Guide to Efficient SAS Programming". I tried searching for this in SAS help but with no success. Using the search button returned 9 entries but none of them has the actual document. Is this resource included in help? Please guide me. Regards, Hari India Hi Hari, Go to Amazon.com and put in that title. It is available there for $12.48 (U.S. dollars). Regards, Barb US - Michigan On Wed, 7 Dec 2005 08:38:48 -0800, Hari <excel_hari@YAHOO.COM> wrote: >Hi, > >I have 9.1.3 > >SAS help lists a particular reference "SAS Programming Tips: A Guide to >Efficient SAS Programming". I tried searching for this in SAS help but >with no success. Using the search button returned 9 entries but none of >them has the actual document. > >Is this resource included in help? > >Please guide me. > >Regards, >Hari >India Here you have some options: http://www.addall.com/New/compare.cgi? dispCurr=USD&id=20437&isbn=1555444318&location=10000&thetime=20051207160332& author=&title=&state=AK Regards, RVV Okay Hari, Here is the Link that you have asked for http://www.sas.com/apps/pubscat/bookdetails.jsp?catid=1&pc=56150 This link even has the SAS code used in the Book have a look at it and decide what you are looking for, Hope this is what you are looking for email me if you need anything more Thanks Bar...

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

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

data generation in SAS program
Can anyone answer this question posted on AnalyticBridge:" I need to generate data from Box and Tiao distribution ..." for details, see: http://www.analyticbridge.com/forum/topics/data-generation-in-sas-program ...

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 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: 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: 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: 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: data generation in SAS program
looks like a log-concave function, rejection sampling should be good On Fri, 1 May 2009 20:52:46 -0400, Vincent Granville <vincentg@DATASHAPING.COM> wrote: >Can anyone answer this question posted on AnalyticBridge:" I need to >generate data from Box and Tiao distribution ..." for details, see: > >http://www.analyticbridge.com/forum/topics/data-generation-in-sas-program ...

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

Re: data programming problem #2
Thank you very much Richard, I am glad you managed to understand my problem and more than that you provided me with a code that works like a charm. I have more then 870,000 subjects so it still crunching, but it is exactly what I needed. Cheers, Cornel -----Original Message----- From: Richard A. DeVenezia [mailto:rdevenezia@wildblue.net] Sent: Saturday, March 08, 2008 12:40 AM To: Cornel Lencar; SAS-L@LISTSERV.UGA.EDU Subject: Re: data programming problem Cornel Lencar wrote: > Hi, > > I have a challenging data programming problem that I can't wrap my > head around. > > I have a daily exposure data for 10 years (woodsmoke presence is 1/0 > or missing) and I have an individual exposure file with individual > IDs, period (s) of exposure (start/end) and weather or not the person > was in an area with woodsmoke exposure: > > > DATE > WOOD > > > 01/01/1994 > 0 01/02/1994 > 0 01/03/1994 > 1 01/04/1994 > 0 01/05/1994 > 1 01/06/1994 > 1 01/07/1994 > ...

Web resources about - data programming problem - comp.soft-sys.sas

Computer programming - Wikipedia, the free encyclopedia
Computer programming (often shortened to programming or coding ) is the process of designing , writing, testing , debugging , and maintaining ...

IBM brings Swift to the cloud, releases web framework Kitura written in Apple’s programming language
Only months after Apple officially open-sourced Swift , IBM today is announcing that they are bringing Apple’s Swift programming language to ...

Upfront Report: Scripps to Double Down on Holiday Programming, Halloween Through Christmas
Scripps Network is doubling down on its holiday programming. As part of its pitch to advertisers during the 2016 upfronts, the cable programmer ...

Stephanie Todd Upped to VP Programming at HLN
Stephanie Todd has been promoted to vp of programming at HLN. Todd, who has been with CNN Worldwide more than 20 years, will have oversight ...

JavaScript Dominates As The No. 1 Most Used Programming Language
Programming languages come and programming languages go. Unless you are JavaScript.

3 reasons why Netflix doesn’t release ratings for its original programming
Impressively, Netflix over the past few years has successfully morphed from a company known for mailing out DVDs into a streaming juggernaut ...

New! The A/V Club: #BlogHer16 Programming Track
... calls to action to increase views Different ways to promote your YouTube content on all of your social media channels Our conference programming ...

Univision Charges AT&T With “Redlining” As Programming Goes Dark On U-Verse
Univision lost access to about 5.6 million U-Verse subscribers last night as the Spanish language broadcast company and AT&T failed to agree ...

Sunday Afternoon ESPN Programming Is Grim
There’s really something to be said for ESPN’s Sunday afternoon programming, when the Worldwide Leader cedes all sports coverage to the broadcast ...

Save hundreds on the Python Programming Bootcamp
Save hundreds on the Python Programming Bootcamp

Resources last updated: 3/17/2016 10:34:42 AM