Got stuck with a problem related to Drop statement.attached herewith the problem and its 4 options.
Please help me to find 1.
Thanks
The question specifically asked for how to specify the drop using dataset options.
Post your questions directly into the forum, not as attachments. Many users will not download attachments.
There are two ways to use DROP statement:
1) data wnat(DROP=var1 var2 ...); /* with the equal sign */
set have;
... any code ...
run;
2) data want;
set have;
... any code ...
DROP var1 var2 ...; /* without the equal sign */
run;
Let's look at the choices.
B anc C are wrong because they have commas.
B and D are wrong because they dont have the equal sign that all dataset options require.
So A is the best answer.
But all four are wrong because the parenthesis themselves are not part of the DROP= dataset option. If you have other dataset options, like LABEL= or RENAME= they would all be nested inside the single set of () following the dataset name.
Hello Tom
But if we look at the given code its doesnt seem like a drop dataset option .
It looks like a statement so should it be the option D but ofcourse as you said without the () brackets.
The question specifically asked for how to specify the drop using dataset options.
@rajvir wrote:
Hello Tom
But if we look at the given code its doesnt seem like a drop dataset option .
It looks like a statement so should it be the option D but ofcourse as you said without the () brackets.
A good rule of thumb if you're not certain about something is to check the documentation. You may not always understand exactly what it's saying, but the examples will often help with that. Reading through the examples may help with your understanding of the DROP dataset option, versus the DROP statement.
DROP, data step option
DROP, statement
Documentation examples/explanations:
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.