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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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.

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