First, let's examine the problem and why you get a note at all.
data have;
name = 'Princess Diana';
rank = 1;
run;
proc transpose data=have out=want;
var name rank;
run;
When transposing a set of variables that include both character and numeric, SAS has a problem. The output variable will have to be character in order to hold "Princess Diana". So SAS has to convert the numeric variable RANK from numeric to character to be able to transpose the data. This leads to several questions:
The basic conclusion is that you don't know what is in your output data set without a vigorous inspection. And if you don't know what is in it, you can't program with it accurately. Thus the note.
If you want to get rid of the note, you have to change your process. Instead of transposing a mix of character and numeric variables, you might use two transposes, one for character variables and one for numeric. Or you might convert all your numeric variables to character before transposing. (How to do this is an often-asked question on this board, but does not have a simple answer.) But just snapping your fingers and removing the note is not an option.
Hello @sasuser123123 ,
I completely agree with @Astounding and I would check whether you get what you really want to get and whether the resulting dataset is the best representation you can think of.
It's much better to alter your programming logic to avoid such a note instead of just suppressing the note. You can suppress the note as in the small program below, but I am very reluctant to tell you as I don't consider that as good programming practice. Warnings for example cannot be suppressed. And Errors can only sometimes be suppressed (if you get more than X times the same error with a PROC, it can be handy to only show the first 10 or so).
options nonotes;
proc transpose data=sashelp.class out=temp;
var name age height;
run;
proc print data=temp width=min;
run;
/* end of programming */
Good luck,
Koen
To be complete:
options nonotes;
exists but I would not use it!
I only use it (very rarely) when a macro does thousands of loops always throwing the same notes. This to avoid the LOG-window running full. And I never suppress the notes for the 1st and last loop.
options nowarning;
---------
13
ERROR 13-12: Unrecognized SAS option name NOWARNING.
Thus, options nowarning does not exist!
options ERROR=20;
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.