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.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 1477 views
  • 1 like
  • 5 in conversation