BookmarkSubscribeRSS Feed
bncoxuk
Obsidian | Level 7
Guys, can you tell me why there is no output for cases with age<=30? OUTPUT statement in the ELSE should not cause any effect.

DATA work.a;
SET work.b;
IF (age>30) THEN status='mature';
ELSE THEN
DO;
status='young';
OUTPUT;
END;
RUN;
3 REPLIES 3
bncoxuk
Obsidian | Level 7
Guys, can you tell me why there is no output for cases with age below 30? The output statement should not cause effect, as it is associated with else only.

DATA work.a;
SET work.b;
IF (age>30) THEN status='mature';
ELSE THEN DO;
status='young';
OUTPUT;
END;
RUN;
DF
Fluorite | Level 6 DF
Fluorite | Level 6
Have a look at your log file for that code. You should be getting a syntax error - the "THEN" keyword is only used in the IF statement and isn't needed for ELSE.
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
I have to ask why you double-posted your query/problem in this forum? Recommend you stay with one post, one topic-point or issue/problem/query....suggested forum etiquette.

Here's your first one:

http://support.sas.com/forums/thread.jspa?threadID=14647

Scott Barry
SBBWorks, Inc. Message was edited by: sbb

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 3 replies
  • 820 views
  • 0 likes
  • 3 in conversation