From: Rob Roszkowski on
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
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

> --
> Remove del for email

Thankyou very much Tom and Barry that helped so so much!

Many Thanks.