From: Rob Roszkowski on 8 Aug 2010 08:27 Hi everyone, I have a real problem on my hands that I need to resolve asap but I don't know how as I have never come across this problem. If anyone can figure this out I truly thank deeply. I have a data set (one of 100) where the date column comes up like this : Date: 20050122->20060121->20070120 20050122->20060121->20070120 20050122->20060121->20070120 20050122->20060121->20070120 20050122 20050123 20050122->20060121 20050256 20050122->20060121 .....etc I have used proc import for this as data infile is totally out of the question for the amount of data sets I have. The date variable is like this accross all my data sets and what I would like it to be is a single date value. Hence for those with multiple dates I would like to select the right-most date so we end up with something like this: Hi everyone, I have a real problem on my hands that I need to resolve asap but I don't know how as I have never come across this problem. If anyone can figure this out I truly thank deeply. I have a data set (one of 100) where the date column comes up like this : Date: 20070120 20070120 20070120 20070120 20050122 20050123 20060121 20050256 20060121 .....etc Experts out there on SAS please help me because this is so so very important that I get it down immediately for my finance thesis. Thank you deeply to anyone who can help me
From: Tom Abernathy on 8 Aug 2010 09:56 If you have want to get the last one as another character variable then use the SCAN function. last_date = scan(date,-1,'>'); If you want to convert it to an actual date then use the INPUT function. ldate = input(last_date,??yymmdd.); format ldate yymmddn8.; On Aug 8, 8:27 am, Rob Roszkowski <rob.roszkow...(a)gmail.com> wrote: > Hi everyone, > > I have a real problem on my hands that I need to resolve asap but I > don't know how as I have never come across this problem. If anyone can > figure this out I truly thank deeply. > > I have a data set (one of 100) where the date column comes up like > this : > > Date: > 20050122->20060121->20070120 > 20050122->20060121->20070120 > 20050122->20060121->20070120 > 20050122->20060121->20070120 > 20050122 > 20050123 > 20050122->20060121 > 20050256 > 20050122->20060121 > ....etc > > I have used proc import for this as data infile is totally out of the > question for the amount of data sets I have. The date variable is like > this accross all my data sets and what I would like it to be is a > single date value. Hence for those with multiple dates I would like to > select the right-most date so we end up with something like this: > > Hi everyone, > > I have a real problem on my hands that I need to resolve asap but I > don't know how as I have never come across this problem. If anyone can > figure this out I truly thank deeply. > > I have a data set (one of 100) where the date column comes up like > this : > > Date: > 20070120 > 20070120 > 20070120 > 20070120 > 20050122 > 20050123 > 20060121 > 20050256 > 20060121 > ....etc > > Experts out there on SAS please help me because this is so so very > important that I get it down immediately for my finance thesis. Thank > you deeply to anyone who can help me
From: Rob Roszkowski on 10 Aug 2010 22:43 > -- > Remove del for email Thankyou very much Tom and Barry that helped so so much! Many Thanks.
|
Pages: 1 Prev: Help" Flag items that happened in the last 'x' months Next: ODS RTF - Grouping |