BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
trekvana
Calcite | Level 5

hello all-

suppose i have a dataset A with one variable x:

data A (keep=x);

do i=1 to 3 by 1;

     do x=1 to 2 by 1; output;

     end;

end; run;

1

2

1

2

1

2

now i want to recode this data set where if x=1 then x='no'; else x='yes'. thus now A will look like

no

yes

no

yes

no

yes

any way to do this?

thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

You have your proc format, use it with a put statement.

x1_temp=put(x1, xone.);

View solution in original post

2 REPLIES 2
Reeza
Super User

You have your proc format, use it with a put statement.

x1_temp=put(x1, xone.);

trekvana
Calcite | Level 5

thanks again reeza 🙂

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1424 views
  • 0 likes
  • 2 in conversation