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

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 964 views
  • 1 like
  • 2 in conversation