Help using Base SAS procedures

How to copy the column values from one to other?

Reply
Regular Contributor
Posts: 168

How to copy the column values from one to other?

I need to understand the SAS code to copy the column value from one to other like below.

Assume i've a table called 'one' with values like below.

a b

1 2

3 4

5 6

I need to copy the column values from a to b and the output should be like

a b

1 1

3 3

5 5

Please suggest the SAS code to achieve this.

Super User
Super User
Posts: 7,401

Re: How to copy the column values from one to other?

Well I assume b in the second table is b from the first table - 1 so:

data want (rename=(new_b=b));

     set have;

     new_b=b-1;

run;

New Contributor
Posts: 3

Re: How to copy the column values from one to other?

I think we shoud assign value of vara to  varb  just like this

data want;

set have;

b=a;

run;

Ask a Question
Discussion stats
  • 2 replies
  • 1833 views
  • 0 likes
  • 3 in conversation