Help using Base SAS procedures

Merge or append?

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 17
Accepted Solution

Merge or append?

Hi, I have a simple question, I think, but have not found an elegant way to implement it.

I have datasetA with 70 rows and a number of variables. I used PROC UNIVARIATE to find percentiles for some of these variables and OUTPUT these percentiles into a new datasetB,which only has the percentiles (one row of data). I want to merge these so that I have the percentile values represented for every row in datasetA so that I can write some simple equations in a new data step. However, when I try to merge these it only joins the percentiles of datasetB to the first row of datasetA. Is there an easy way to do this?

Thanks in advance,

peat


Accepted Solutions
Solution
‎08-12-2015 11:56 AM
Super User
Posts: 19,850

Re: Merge or append?

Posted in reply to peatjohnston

I think it's like this:

data have;

if _n_=1 then set percentiles;

set data;

run;

Here's a reference if you want several other options:

http://www2.sas.com/proceedings/sugi28/103-28.pdf

View solution in original post


All Replies
Solution
‎08-12-2015 11:56 AM
Super User
Posts: 19,850

Re: Merge or append?

Posted in reply to peatjohnston

I think it's like this:

data have;

if _n_=1 then set percentiles;

set data;

run;

Here's a reference if you want several other options:

http://www2.sas.com/proceedings/sugi28/103-28.pdf

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 1 reply
  • 268 views
  • 0 likes
  • 2 in conversation