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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 377 views
  • 0 likes
  • 2 in conversation