I have a data set that is currently a 3 by 160 table of movie reviews. The first row is numbers for the movie reviews. I want to separate the table in to 4 smaller tables with values 1-40 in the first table, 41-80 for the second table, etc. I also want to drop the first column of numbers from these tables. This is the code I am trying for the first table but it is not working.
DATA movie;
FILENAME webpage URL 'http://people.stat.sc.edu/hitchcock/moviereview.txt';
INFILE webpage;
INPUT reviewnumber $ Siskel $ Ebert $;
DROP reviewnumber
RUN;
PROC PRINT DATA=movie;
WHERE reviewnumber CONTAINS BETWEEN 1 AND 40;
TITLE 'Quarter 1';
RUN;
1) Can reviewnumber be non numeric ? why not read it as numeric, without the $ symbol ?
2) Assume reviewnumber is 1 - is it '1 ' or '01' or ' 1' ?
3) Assume reviewnumber is 12 - does it contain 1 ?
I believe that changing the reviewnumber to numeric and check by
" where reviewnumber between 1 and 40 " instead using contain function - can solve the issue
otherwise post your log and explain what do you mean by "not working".
1) Can reviewnumber be non numeric ? why not read it as numeric, without the $ symbol ?
2) Assume reviewnumber is 1 - is it '1 ' or '01' or ' 1' ?
3) Assume reviewnumber is 12 - does it contain 1 ?
I believe that changing the reviewnumber to numeric and check by
" where reviewnumber between 1 and 40 " instead using contain function - can solve the issue
otherwise post your log and explain what do you mean by "not working".
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.