DATA Step, Macro, Functions and more

How to add a new column in existing dataset

Occasional Contributor
Posts: 12

How to add a new column in existing dataset



I want to add new columns to an existing dataset. The new column should contain the data from another dataset. 


Here it looks like this



data sumOut;
set work.dresssales1;


I want to add the value that is stored in sumvar to a new dataset Retail. How do I do this ?








Super User
Posts: 10,483

Re: How to add a new column in existing dataset

Do you have variables in both data sets to identify which records are supposed to align such as a product identifier, store identifier, dates or possibly multiple variables? If you have those key variables are combinations of them duplicated within one or both of the data sets?


It would be better to provide examples of BOTH data sets. This link has instructions on how to make data step code to replicate the data that you can post here or attach as a TEXT file.

It is also a very good idea to provide an example of what your are looking for as a result in case your narrative description is incomplete.

Ask a Question
Discussion stats
  • 1 reply
  • 1 like
  • 2 in conversation