SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
FrustratedBio
Calcite | Level 5

So here is my code. It works for rotating the dataset I need it to, however, I cannot seem to rid myself of the missing values in the output table. My instructor says "do not output an observation if the value is missing." Anyone know how you do that?

 

 

libname bst5030 '/folders/myfolders/sasuser.v94/Data for classes 8 to 11 (2)';
data rotate sixmonths_Long (keep= customer_ID Month Sales);
set bst5030.orders_midyear;
array mon[6] Month1-Month6;
do Month=1 to 6;
Sales=mon[Month];
output;
end;
run;

Proc print data=sixmonths_Long;
run;

1 ACCEPTED SOLUTION

Accepted Solutions
2 REPLIES 2
Shmuel
Garnet | Level 18

If not missing(sales) then output;

FrustratedBio
Calcite | Level 5
Thanks a bunch! I was doing that but I realized that it doesn't work unless I put it BEFORE the statement end.

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 2 replies
  • 590 views
  • 0 likes
  • 2 in conversation