Hi all! I'm new to SAS (using UE) and am trying to take two datasets, merge them, and then create a new column of calculations. I have one data set (dist) that has 1 row/observation of data (the mean, percentile, and cutprobs) and another data set (brr_runs) that holds 16 rows/observations with nearly identical variables (mean, percentiles, and cutprobs but with "b" in the title to separate them from the initial run). I'd like to merge them and then calculate the squared difference between each estimate in the brr_runs set and the baseline parameters (located in dist). This is what I'm attempting: data distall; merge dist brr_runs; array varo (*) mean_mc_t tpercentile1-tpercentile99 cutprob1-cutprob4; array bvar (*) bmean_mc_t btpercentile1-btpercentile99 bcutprob1-bcutprob4; array dsqr (*) dbmean_mc_t dbtpercentile1-dbtpercentile99 dbcutprob1-dbcutprob4; do i=1 to dim(bvar); dsqr[i]=(bvar[i]-varo[i])**2; end; run; However, when I run this it creates a data set "distall" that has mostly missing values. I've tried manipulating it, but have run into the same issue. It also has created "distall" with 17 rows of identical data (as in, it just took one observation from the original datasets and recreated it 16 times). Can anyone give me some guidance on this? Thanks!
... View more