Date: Wed, 19 Apr 2006 02:45:11 -0400
Reply-To: Arild S <kog@SSB.NO>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Arild S <kog@SSB.NO>
Subject: Re: Formating missing values in date column
Hi,
skip the $ -sign in your format. Dates are numeric.
Try :
proc format;
value NAVdate
. ='N/AV'
other=[mmddyy8.];
run;
options yearcutoff=1920;
data test;
input start : mmddyy8. stop : mmddyy8.;
cards;
01/19/06 02/02/06
01/19/06 .
01/30/06 02/02/06
01/26/06 01/28/06
01/08/06 01/16/06
;
proc print; format _numeric_ NAVdate.;
run;
On Wed, 19 Apr 2006 11:30:13 +0530, Madan Gopal Kundu
<Madan.Kundu@RANBAXY.COM> wrote:
>Hi,
>I have the following dataset with two columns of date. The last column
>contain missing value at three positions. Now what I need to do is to
>replace those missing values by NAV.
>
>
>
>Original dataset:
>
> start_ stop_
>
> Obs date date
>
>
>
> 1 01/19/06 02/02/06
>
> 2 01/19/06 .
>
> 3 01/30/06 02/02/06
>
> 4 01/26/06 01/28/06
>
> 5 01/08/06 01/16/06
>
> 6 01/23/06 01/26/06
>
> 7 01/23/06 01/26/06
>
> 8 12/30/05 01/25/06
>
> 9 01/10/06 .
>
> 10 01/17/06 01/25/06
>
> 11 01/24/06 01/30/06
>
> 12 01/15/06 01/29/06
>
> 13 02/01/06 02/05/06
>
> 14 02/17/06 .
>
> 15 02/01/06 02/05/06
>
> 16 01/28/06 02/06/06
>
> 17 02/02/06 02/06/06
>
> 18 02/04/06 02/14/06
>
> 19 02/03/06 02/18/06
>
>
>
>Wanted :
>
> start_ stop_
>
> Obs date date
>
>
>
> 1 01/19/06 02/02/06
>
> 2 01/19/06 NAV
>
> 3 01/30/06 02/02/06
>
> 4 01/26/06 01/28/06
>
> 5 01/08/06 01/16/06
>
> 6 01/23/06 01/26/06
>
> 7 01/23/06 01/26/06
>
> 8 12/30/05 01/25/06
>
> 9 01/10/06 NAV
>
> 10 01/17/06 01/25/06
>
> 11 01/24/06 01/30/06
>
> 12 01/15/06 01/29/06
>
> 13 02/01/06 02/05/06
>
> 14 02/17/06 NAV
>
> 15 02/01/06 02/05/06
>
> 16 01/28/06 02/06/06
>
> 17 02/02/06 02/06/06
>
> 18 02/04/06 02/14/06
>
> 19 02/03/06 02/18/06
>
>
>
>I have tried the following format statement:
>
>
>
>proc format;
>
>value $date . ='N/AV' other=[mmddyy8.];
>
>run;
>But it can not serve my purpose.
>
>
>
>Please show me some way.
>Thanks and regards,
>Madan Kundu
|