LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (May 2008, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 20 May 2008 07:19:48 -0700
Reply-To:     karma <dorjetarap@GOOGLEMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         karma <dorjetarap@GOOGLEMAIL.COM>
Organization: http://groups.google.com
Subject:      Re: Variation between dates
Comments: To: sas-l@uga.edu
Content-Type: text/plain; charset=ISO-8859-1

On 20 May, 14:57, Nanita <susana.urb...@gmail.com> wrote: > Hi there, > > I need to calculate the variation in "VALOR" between dates (1 day > diference). How can I do that? > > Thanks. > > CODFONTE CODTIT ULTDATA MOEDA BOLSA CODITEM VALOR DTALT > 1 100019900833 20080417 EUR LUXEMBOURG Preco 15H30 96.224 17-04-2008 > 1 100019900833 20080418 EUR LUXEMBOURG Preco 15H30 96.249 18-04-2008 > 1 100019900833 20080421 EUR LUXEMBOURG Preco 15H30 95.764 21-04-2008 > 1 100019900833 20080422 EUR LUXEMBOURG Preco 15H30 96.256 22-04-2008 > 1 100019900833 20080423 EUR LUXEMBOURG Preco 15H30 96.367 23-04-2008 > 1 100019900833 20080424 EUR LUXEMBOURG Preco 15H30 96.366 24-04-2008 > 1 100019900833 20080425 EUR LUXEMBOURG Preco 15H30 95.562 25-04-2008 > 1 100019900833 20080428 EUR LUXEMBOURG Preco 15H30 96.416 28-04-2008 > 1 100019900833 20080429 EUR LUXEMBOURG Preco 15H30 96.843 29-04-2008 > 1 100019900833 20080430 EUR LUXEMBOURG Preco 15H30 96.848 01-05-2008 > 1 100019900833 20080502 EUR LUXEMBOURG Preco 15H30 96.851 02-05-2008 > 1 100019900833 20080505 EUR LUXEMBOURG Preco 15H30 96.855 05-05-2008 > 1 100019900833 20080506 EUR LUXEMBOURG Preco 15H30 96.857 06-05-2008 > 1 100019900833 20080507 EUR LUXEMBOURG Preco 15H30 96.887 07-05-2008 > 1 100019900833 20080508 EUR LUXEMBOURG Preco 15H30 96.869 08-05-2008 > 1 100056520533 20080104 EUR EURONEXT-LISBON Preco 15H30 99.625 > 04-01-2008 > 1 100056520533 20080107 EUR EURONEXT-LISBON Preco 15H30 99.616 > 08-01-2008 > 1 100056520533 20080109 EUR EURONEXT-LISBON Preco 15H30 99.633 > 09-01-2008 > 1 100056520533 20080110 EUR EURONEXT-LISBON Preco 15H30 99.64 > 11-01-2008 > 1 100056520533 20080111 EUR EURONEXT-LISBON Preco 15H30 99.634 > 14-01-2008 > 1 100056520533 20080115 EUR EURONEXT-LISBON Preco 15H30 99.676 > 15-01-2008 > 1 100056520533 20080116 EUR EURONEXT-LISBON Preco 15H30 99.661 > 16-01-2008 > 1 100056520533 20080117 EUR EURONEXT-LISBON Preco 15H30 99.671 > 17-01-2008 > 1 100056520533 20080118 EUR EURONEXT-LISBON Preco 15H30 99.702 > 18-01-2008 > 1 100056520533 20080121 EUR EURONEXT-LISBON Preco 15H30 99.708 > 21-01-2008 > 1 100056520533 20080122 EUR EURONEXT-LISBON Preco 15H30 99.719 > 22-01-2008 > 1 100056520533 20080123 EUR EURONEXT-LISBON Preco 15H30 99.701 > 24-01-2008 > 1 100056520533 20080125 EUR EURONEXT-LISBON Preco 15H30 99.691 > 25-01-2008

you could use the lag function:

data testt; set values; diff=valor-lag(valor); run;


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