Manipulating Data in Base SAS® Part 3 – Deduplicate
Recent Library Articles
Recently in the SAS Community Library: Duplicates in data can badly skew the results of an analysis. @SASJedi demonstrates data deduplication using PROC SORT with the NODUPKEY, OUT=, and DUPOUT= options and PROC SQL and PROC FedSQL
Hi all, I have 4 datasets as below and requirement for the table want are : - Ignore col1 values which are not common for all 4 tables - join all col1 col2 col3 col4 values in the want table to show all different values for col2 in each table. Table 1 col1 col2 1 yes 2 yes 3 yes 4 yes 5 Table 2 col1 col2 1 yes 2 no1 3 yes 4 no1 Table 3 col1 col2 1 yes 2 no2 3 yes 4 no2 Table 4 col1 col2 1 yes 2 no3 3 yes 4 no3 table want col1 col2 col3 col4 col5 1 yes yes yes yes 2 yes no1 no2 no3 3 yes yes yes yes 4 yes no1 no2 no3 Thanks in advance kajal
... View more
Hello,
When we run proc sql with dictionary.formats, we can get following information:
Could any one tell me what 'B', 'U', 'C' stands for in col 'source'?
Thanks.
... View more
Hi,
it is possible to define the height and width of the graph image using the ods graphics statement.
But I could not find an option to define the height and width of the wall space.
It is possible with proc sgplot and/or proc template?
Cheers
... View more
This is the code ods output Quartiles= median_ci(where=(percent=50));
proc lifetest data=test;
time duration*censor(1);
strata group;
run; It runs, but in results for quartile estimates it only shows complete data (point estimate, 95 CI) for the percent 25. There is no point estimate for 50 or 75. For this percents, it only shows the lower CI. Is this something to do with the data? Should I calculate the median and CI with another proc? The median and CI are to describe survival data. Any help is appreciated.
... View more
I would like to use the same if statement across different variables. I have 31 of these variables and would like to avoid typing multiple IF statements. Is there a more elegant way to achieve this? Here is my code: data want;
set have;
%let ab = ab1-ab31;
if a1 = '0' and b1='0' then ab1='1';
else ab1='0';
if a2 = '0' and b2='0' then ab2='1';
else ab2='0';
if a3= '0' and b3='0' then ab3='1';
else ab3='0';
...
if a31 = '0' and b31='0' then ab31='1';
else ab31='0';
n_ab=sum((countc(cats(of &ab),'1')));
drop &ab;
run;
... View more