BookmarkSubscribeRSS Feed
cmsunilkumar
Calcite | Level 5

Hi Experts,

 

I am new to SAS and learning to complete my school assignment in which I am having some challenges.

 

I was instructed to use Work.heart1 data set as input and asked to create 4 new variables into new data set called Work.Heart2.
 
For this I used Recode Values from task option to generate new variable, but it is allowing to change only one variable at a time. Also, every time I need to make new dataset from Work.Heart2 to Work.Heart3 until Work.Heart5 for generating 4 new variables like Chol_StatusNew, Sex_New, Weight_StatusNew & Smoking_StatusNew.
 
Also, in continuation to above question I need to use Work.Heart2 data set and create a new library and with output data set that contains new variables created in above step and old variables in the dataset. This step I am unable to start.
 
Kindly help me how to do this task.

Regards,
Sunil
2 REPLIES 2
Reeza
Super User

Sounds like you're using the point and click system. Take the code from each step and combine them into one step instead. 

Coding allows you to do multiple things in one step, the GUI does one thing at a time and you stack them together. The Tasks do allow you to rename the data set and choose where to save the output data sets. 

D_Dunlap
SAS Employee

Hello,

To reinforce your learning of SAS Programming language/code, not point and click , you may want to consider taking the FREE SAS Programming 1 course where creating SAS libraries and new variables are topics that are addressed in the course along with many other. You can find the free e-learning here.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 523 views
  • 2 likes
  • 3 in conversation