BookmarkSubscribeRSS Feed
Ananyayadav
Calcite | Level 5

I am getting missing values in every column of my data set after running this below proc sort code.

can anyone help me with this?

 

Proc sort data=lib.grocery_couponsx out=sorted_freq; 
by gender; 
run;

 

data set is created successfully but allover missing values.

5 REPLIES 5
PeterClemmensen
Tourmaline | Level 20

Post your log please? And run a PROC FREQ on your data before and after your sort.

 

My guess is that the sort is performed correctly, but the sort brings the missing values to the top.

PaigeMiller
Diamond | Level 26

A very useful habit to get into is to actually look, with your own eyes, at the data set that is giving the unexpected result (in this case lib.grocery_coupons) to see if there are missings present. You can use PROC PRINT or PROC FREQ or Viewtable (and probably other tools) to see what is in the data set.

 

In this case, I'm sure looking at the data set would solve your problem.

--
Paige Miller
VDD
Ammonite | Level 13 VDD
Ammonite | Level 13

I had errored in my prior statement where I had said proc sort, I meant proc freq as @novinosrin has noted.

correction is, one way that I check to confirm I have data is by using proc freq:

proc freq data=lib.grocery_couponsx;
tables gender / missing out=sorted_freq;
run;

 

by using the  / missing I get a count of records with missing values in my output.  If I am ok with them being there I leave them else I delete them.

 

I use the missing option with proc freq to see if records are slipping past me.  Sorry to the community for any miss leading understanding this may have created.

corrected code statement should have been.

 

 

 

 

novinosrin
Tourmaline | Level 20

Hi @VDD Your code is incorrect as there isn't ant /missing option in a proc sort. I think you prolly meant proc freq. Kindly verify the documentation online. Thanks

sas-innovate-white.png

🚨 Early Bird Rate Extended!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.

 

Lock in the best rate now before the price increases on April 1.

Register now!

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
  • 5 replies
  • 2001 views
  • 2 likes
  • 6 in conversation