|
Madan:
Try the following and output follows the code.
proc format;
value datenav ._ - .Z ='NAV'
OTHER =[mmddyy8.];
run;
data Temp;
input start_:mmddyy8. stop_:mmddyy8.;
format start_ stop_ datenav.;
datalines;
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
01/23/06 01/26/06
01/23/06 01/26/06
12/30/05 01/25/06
01/10/06 .
01/17/06 01/25/06
01/24/06 01/30/06
01/15/06 01/29/06
02/01/06 02/05/06
02/17/06 .
02/01/06 02/05/06
01/28/06 02/06/06
02/02/06 02/06/06
02/04/06 02/14/06
02/03/06 02/18/06
;
run;
proc print;
run;
***** Output *****
The SAS System 12:07
Tuesday, April 18, 2006 76
Obs start_ stop_
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
J S Huang
1-515-557-3987
fax 1-515-557-2422
>>> Madan Gopal Kundu <Madan.Kundu@RANBAXY.COM> 04/19/06 1:00 AM >>>
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
(i) The information contained in this e-mail message is intended only
for the confidential use of the recipient(s) named above. This message
is privileged and confidential. If the reader of this message is not the
intended recipient or an agent responsible for delivering it to the
intended recipient, you are hereby notified that you have received this
document in error and that any review, dissemination, distribution, or
copying of this message is strictly prohibited. If you have received
this communication in error, please notify us immediately by e-mail, and
delete the original message.
(ii) The sender confirms that Ranbaxy shall not be responsible if this
email message is used for any indecent, unsolicited or illegal purposes,
which are in violation of any existing laws and the same shall solely be
the responsibility of the sender and that Ranbaxy shall at all times be
indemnified of any civil and/ or criminal liabilities or consequences
there.
|