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

Hey everyone, 

 

I am thankful for your help and kind cooperation.I really appreciate it.  I have some questions,  I  just wanna make sure if I understand some point in SAS correctly ! 

 

First question is The OUTPUT statement is allowed in the DO block? 

for Example, 
IF Type = 'D' THEN DO;
OUTPUT;
OUTPUT;
END;
ELSE OUTPUT;
RUN;

 

 

The Second question is regarding to the SET statement is specifies an input data set in the data step or 

in Proc Sort step ?

 

I think it specifies an input data set in the DATA step

 

Thank you on advance for your time, 

1 ACCEPTED SOLUTION

Accepted Solutions
japelin
Rhodochrosite | Level 12
The OUTPUT statement is allowed in the DO block.

SET statement is specifies an input data set in the data step.
Not in proc step.

View solution in original post

4 REPLIES 4
PaigeMiller
Diamond | Level 26

First question is The OUTPUT statement is allowed in the DO block?

 

The easiest way to find out is to try it.

 

The Second question is regarding to the SET statement is specifies an input data set in the data step or

in Proc Sort step ?

Again, trying it would be faster than posting a question in this community and then waiting for an answer. And probably you'd have the satisfaction of learning the answer rather than being told the answer.

--
Paige Miller
japelin
Rhodochrosite | Level 12
The OUTPUT statement is allowed in the DO block.

SET statement is specifies an input data set in the data step.
Not in proc step.

Malk020
Fluorite | Level 6
Thank you very much. I appreciate it.
Tom
Super User Tom
Super User

Are these questions some exam that someone has given you?

Are they YES/NO, Multiple Choice or open response questions?

 

The OUTPUT statement is allowed:

Spoiler
Anywhere in a DATA step.

The SET statement is:

Spoiler
one of the ways to read in data in a data step.

The SORT procedure :

Spoiler
Does not support either the SET or OUTPUT statements.  To specify the input dataset use the DATA= option on the PROC SORT statement.  To specify the output dataset use the OUT= option on the PROC SORT statement.

 

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 4 replies
  • 403 views
  • 1 like
  • 4 in conversation