LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (September 1996, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 2 Sep 1996 12:49:24 -0700
Reply-To:     Paul Choate <pchoate@EARTHLINK.NET>
Sender:       "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From:         Paul Choate <pchoate@EARTHLINK.NET>
Organization: Earthlink Network, Inc.
Subject:      Re: Need help with SAS problem


I don't know the structure of your data, but here are two approaches that might work:

1) Sort your data by company, anlysis variable, and year. Use the lag function to access the prior year's data for use with the current year.

2) Create a new variable that assigns an unique value to each record grouping you intend to analyze. Use that variable in the class statement of a proc means or summary.

Paul Choate

Alan Olinsky wrote: > > Hi, > I'm sure that this problem has a simple solution, but I'm not sure of > the best approach to use with SAS. I have extracted financial data > from Compustat and I have it in the form of a SAS dataset. I have no > problem referencing the variables or data in this set. The data that I > extracted covers five years, 1991-1995, and contains several companies > with various financial information about each one for each of the years. > I need to reference a variable from two different years, say inventory, > average the two values and then store the result in a new variable in the > newer of the two years. I've tried to do this in various ways with the > DATA Step, but haven't had any success. I'm sure that this is not a > difficult problem, but I would appreciate some help in determining the > best way to proceed. Please respond directly to me as I don't belong to > the SAS-L list at this time. Thanks for your help. > Alan > > --------------------------------------------- > | Alan Olinsky <AOLINSKY@KEYNES.BRYANT.EDU> | > | Bryant College | > | Smithfield, RI 02917 | > | (401) 232-6266 | > ---------------------------------------------

Back to: Top of message | Previous page | Main SAS-L page