BookmarkSubscribeRSS Feed
olivia123456
Fluorite | Level 6
  1. Based on the SAS program A, program Band output tableto complete SAS program C.

 

Program A :

 

DATA A;

      INPUT NAME $ YEAR X;

CARDS;

TOM 10 12

MARY 6 9

NANCY 4 8

RUN;

PROC SORT DATA=A;

      BY NAME;

RUN;

 

Program B

 

DATA B;

INPUT NAME $ YEAR Y;

CARDS;

TOM 5 34

NANCY 3 11

ALICE 5 10

RUN;

PROC SORT DATA=B;

BY NAME;

RUN;

 

Program C

 

DATA C;

______________________________;

 

_____________________________;

 

RUN;

 

PROC PRINT DATA=C;

RUN;

 

 

 

 

 

Obs

NAME

YEAR

X

Y

1

ALICE

5

.

10

2

MARY

6

9

.

3

NANCY

3

8

11

4

TOM

5

12

34

Output table

 

2 REPLIES 2
Patrick
Opal | Level 21

@olivia123456 

Please don't just post your homework without demonstrating any own effort. This is just wasting our time plus you won't learn a things.

 

To give you a hint: You need to use a MERGE / by name for Data C.

andreas_lds
Jade | Level 19

And, please, don't code all upcase, because it reduced readability. Code is best posted by using the running-man icon, to preserve formatting.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 2 replies
  • 402 views
  • 0 likes
  • 3 in conversation