Hi all:
I am basic level programmer. Just have a quick question. what does output do in this situation?
data lb;
set rawdata.lab;
if A eq 1 or 2 or 3 then B= "DOSE ADMINISTRATION";
else " ";
output;
run;
@buddha_d Please mark the question as solved, not this post, but the one that answered your question.
Get the syntax right with:
data lb;
set rawdata.lab;
if A in (1, 2, 3) then B= "DOSE ADMINISTRATION";
run;
For all intents in purposes in your example it does nothing. If there is no output statement in a data step one is assumed at the bottom of the code.
You could test this by creating a small example input data set and running the code both with and without the output.
Output is executeable. It will write the current state of the data vector to an output data set. So if you have multiple output statements you may generate multiple records from a single input record.
Also you may specify the name of a data set that appears on the DATA statement (data setone settwo; specifies two data sets for example) to indicate which data set(s) get the data.
@buddha_d Please mark the question as solved, not this post, but the one that answered your question.
I said not this post..... 😞
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.