BookmarkSubscribeRSS Feed
Abiodun
Calcite | Level 5

Hello Team,

 

I need support on the code below, it keeps returning "error."

My objective is to Use WORK.HEART2 as the input dataset, then create a library named HEARTLIB with an output dataset named HEARTLIB.MYHEART that contains only observations that have non-missing values for the variables below: 

 

AgeAtStart 

Height 

Systolic 

BP_Status 

MRW 

Weight 

Chol_StatusNew 

Sex_New 

Weight_Status 

Cholesterol 

Smoking 

Weight_Status2 

Diastolic 

Smoking_StatusNew 

 

 

 

libname heartlib "/home/u41093773/HeartLib";

 

data heartlib.myheart;

set heart2;

if nmiss(ageatstart, cholesterol, diastolic, Height, MRW, Smoking, Systolic,

     Weight) = 0 and

   cmiss(bp_status, chol_statusnew, smoking_statusnew, weight_statusnew) = 0 then output;

run;

 

proc freq data=heartlib.myheart;

 

tables _character_ / missing;

run;

 

proc means data=heartlib.myheart nmiss;

var _numeric_;

run;

1 REPLY 1
Kurt_Bremser
Super User

Whenever you have WARNINGs or ERRORs, or other issues with your code, post the complete log (all code and all messages) by copy/pasting it into a window opened with this button:

Bildschirmfoto 2020-04-07 um 08.32.59.jpg

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
  • 1 reply
  • 1079 views
  • 1 like
  • 2 in conversation