From: yash on 15 Jun 2010 06:22 Hi I want to know whether Selecting single observation from a table and doing arithmetic operations on it is possible or not. e.g. data dates; input name $ dob mmddyy10.; cards; yash 12-02-1986 raj 04-12-1947 ; run; Now i want to get date of birth for yash and add 21 more days to it and print it only ...being more specific what i want to know is "are the observations here can be selected and manipulted individually from a dataset?" i don't want to change whole dataset i want to change only one record
From: Patrick on 15 Jun 2010 07:34 One of many ways of doing this: proc sql; update dates set dob=dob+21 where name='yash' ; quit;
From: vatodorov on 15 Jun 2010 08:34 Yes, you can manipulate only selected observations from a dataset. You can use the condition "if x=1 then do;" In your case it will be: **** Modify the record for 'yash'; data dates; set dates; format dob mmddyy10.; if name='yash' then do; dob=dob+21; end; run; **** Print only 'yash'; proc print data = dates; var _all_; where name='yash'; run; Valentin vatodorov.com
|
Pages: 1 Prev: Weighted Covairance Calculation Next: Solaris Administrator |