I have this question below. Should it be drop = lev1 lev2? I'm not sure what else is wrong with this program. Any help is greatly appreciated!
1. What, if anything, is wrong with the following program? As usual, an ellipsis (. . .) represents portions of the program that have no bearing on the exercise.
data one;
infile . . . ;
input id $ subgrp $ lev1 lev2;
total = lev1 + lev2;
drop lev1 lev2;
run;
proc freq data=one;
tables total lev1 lev2;
run;
You dropped lev1 and lev2 from data set one, therefore they do not exist in data set one.
DROP removes variables from the data set.
In the PROC FREQ you then try to use LEV1, LEV2 but they no longer exist.
@Amy0223 wrote:
I have this question below. Should it be drop = lev1 lev2? I'm not sure what else is wrong with this program. Any help is greatly appreciated!
1. What, if anything, is wrong with the following program? As usual, an ellipsis (. . .) represents portions of the program that have no bearing on the exercise.
data one;
infile . . . ;
input id $ subgrp $ lev1 lev2;
total = lev1 + lev2;
drop lev1 lev2;
run;
proc freq data=one;
tables total lev1 lev2;
run;
You dropped lev1 and lev2 from data set one, therefore they do not exist in data set one.
DROP removes variables from the data set.
In the PROC FREQ you then try to use LEV1, LEV2 but they no longer exist.
@Amy0223 wrote:
I have this question below. Should it be drop = lev1 lev2? I'm not sure what else is wrong with this program. Any help is greatly appreciated!
1. What, if anything, is wrong with the following program? As usual, an ellipsis (. . .) represents portions of the program that have no bearing on the exercise.
data one;
infile . . . ;
input id $ subgrp $ lev1 lev2;
total = lev1 + lev2;
drop lev1 lev2;
run;
proc freq data=one;
tables total lev1 lev2;
run;
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.