09-11-2012 11:16 AM
When I do this step i am not getting a and b merged instead the info available in other dataset also appears . Likewise with c and d and e and f also..........!!!!Can somebody help me?
data LOS_final_1 MORT_final_1 READMITS_final_1;
if a and b then output LOS_final_1;
if c and d then output MORT_final_1;
if e and f then output READMITS_final_1;
09-11-2012 11:32 AM
You will need to add either a KEEP= or DROP= option to the output data sets to get the variables you want. The choice would depend on which creates a longer list. It might look something like this
data LOS_final_1 ( keep = Discharge_Quarter var1 var2)
MORT_final_1 ( drop = var5-var15)
READMITS_final_1 (keep = list of variable names you want);
09-11-2012 11:42 AM
The variablke names are different for each of these datasets except for only 2 variable names which are common to all the rank datasets.
the variable names for the percentiles dataset are different.
BASICALLY I DINT WANT TO DO THIS STEP:
merge LOS_ranks(in=a) LOS_Percentiles(in=b);
merge MORT_ranks(in=a) MORT_Percentiles(in=b);
merge READMITS_ranks(in=a) READMITS_Percentiles(in=b);
09-11-2012 12:11 PM
Then this illustrates a good lesson. While there are often many ways to achieve an acceptable solution in SAS, pick the right tool for the job. If you do, your program will usually be short and simple. If you pick the wrong tool for the job, your program will become complex and more difficult to work with. Occasionally, a programming objective requires complexity. (Unfortunately, if you hang out here you see a non-representative sample of more complex problems, not the simple ones.) As a general rule, if your program is become complex, think about whether there is another way to get what you want.