Help using Base SAS procedures

Creating New Variable and Assigning Value

Accepted Solution Solved
Reply
Contributor
Posts: 35
Accepted Solution

Creating New Variable and Assigning Value

Hi Guys,

I am trying to create a new variable in my data set, followed by assigning the value zero to this variable.

I.e.

A                  B                C                  Newvariable

John        Student       Male                    0

Mary         Teacher      Female              0

Pasty        Musician    Female               0

May I know how do I code this?

Thanks!


Accepted Solutions
Solution
‎01-11-2013 01:02 PM
Super Contributor
Posts: 1,636

Re: Creating New Variable and Assigning Value

data new;

set old;

newvariable=0;

run;

View solution in original post


All Replies
Solution
‎01-11-2013 01:02 PM
Super Contributor
Posts: 1,636

Re: Creating New Variable and Assigning Value

data new;

set old;

newvariable=0;

run;

🔒 This topic is solved and locked.

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

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