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.
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.
Proc sort does not change any values, only the order. So your problem happens before this sort step.
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.
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.
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
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.
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.
Ready to level-up your skills? Choose your own adventure.