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

SQ.jpg

Hello,

why the answer is 8, I think is 3.

can some solve my problem, thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

@teddyyu1622 Please mark the question as solved once you've received a solution that works for you. Please select the correct solution and choose that as the answer. 

 

View solution in original post

5 REPLIES 5
japelin
Rhodochrosite | Level 12
obs var1 results
1    A   ->output because "if statemens" is true
2    A   ->output because "if statemens" is true
3    B
4    C
5    A   ->output because "if statemens" is true

and the last output statement output all the obs.

 

teddyyu1622
Calcite | Level 5
thanks, I got it .
Reeza
Super User

@teddyyu1622 Please mark the question as solved once you've received a solution that works for you. Please select the correct solution and choose that as the answer. 

 

ballardw
Super User

I would suggest making the data set and running the code to see the results.

 

Work.one gets 3 records from the first conditional Output.

Then OUTPUT writes records to both output sets unconditionally, so that is 5 records written to both.

Result: 8 records.

 

Harkonnen
Fluorite | Level 6
Because there are two outputs in the program. The first one will output var1=a in dataset ONE. The second one will output all presented observations in both datasets. So there will be 8 (3+5) obs in summary.

SAS Innovate 2025: Call for Content

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!

Submit your idea!

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
  • 5 replies
  • 840 views
  • 1 like
  • 5 in conversation