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.
Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.
Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.
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.