BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
buddha_d
Pyrite | Level 9

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;

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

@buddha_d Please mark the question as solved, not this post, but the one that answered your question.

View solution in original post

6 REPLIES 6
PGStats
Opal | Level 21

Get the syntax right with:

 

data lb;
set rawdata.lab;
if A in (1, 2, 3) then B= "DOSE ADMINISTRATION";
run;
PG
ballardw
Super User

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
Pyrite | Level 9

Thanks 

Reeza
Super User

@buddha_d Please mark the question as solved, not this post, but the one that answered your question.

Reeza
Super User

I said not this post..... 😞

buddha_d
Pyrite | Level 9
sorry I am not so got confused.

##- Please type your reply above this line. Simple formatting, no
attachments. -##

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 6 replies
  • 811 views
  • 0 likes
  • 4 in conversation