hallo,
how kann i find or delete if the any Variable in a table have the same value?
for Ex:
if the var1 have only value "test" then i dont need that Variable.
I have 1478 Variable. i can not look at every Variable wiht Prog tabulate or freq.
best Regards
Celal
Consider this proc freq. Depending on your data this may be "too much". If you have variables that you know have more than one level you could drop them from consideration. data=sashelp.heart(drop=.......);
Thanks but there is no error message:
ERROR: The SAS System stopped processing this step because of insufficient memory
Do you know another way? or with macro?
Thanks a lot
I suspected that, don't do so many variables at once and or drop any you know do no need to be tested.
For numeric variables, it would be possible to use PROC MEANS instead of PROC FREQ. The program could compare the MIN to the MAX for each variable, to see whether they differ. (That would not identify variables that are always either missing or some other constant value.) The difficultly with that approach is that it gets a little complex. A simpler way would be to have PROC MEANS compute the range:
proc means data=have noprint;
var _numeric_;
output out=stats (drop=_freq_ _type_) range=;
run;
The values in the output data set should be easy to parse in a DATA step to figure out which values change. The only complication is that the DATA step would need to use an array with the VNAME function to determine the original variable name.
That approach would let you limit PROC FREQ to handling just the character variables ... possibly with enough memory to do the job.
Good luck.
I think this SAS-L thread address the subject well.
http://www.listserv.uga.edu/cgi-bin/wa?A2=ind0712C&L=sas-l&D=0&P=42815
It includes participation from some real SAS programming "heavy hitters" and one not so much (me).
Thanks, DN. That was a heck of thread. Many famous names. Are they all retired or some? Don't see them often on SAS-L anymore.
Not much going on on SAS-L at all these days, although most of the participants in that thread are still around from time to time.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.