DATA Step, Macro, Functions and more

Sort Data ID's without deleting data columns

Reply
Occasional Contributor
Posts: 7

Sort Data ID's without deleting data columns

Hi,

 

 

I have three data that i want to sort. DataA, DataB, and baseline

 

I used the following syntax:

data dataa;
  input ID @@;
  cards;
501 502 503 504 505 506 507 508 509 510
;
Data datab;
  input ID @@;
  cards;
501 502 503 504 505 506 507 508 509 510
;
data baseline;
  input ID @@;
  cards;
501 502 503 504 505 506 507 508 509 510 601 602 603 604 605
;

 

 

Resorting by ID was accomplished however all other columns from all three data were deleted. How can i resort my ID without deleting any columns?

 

Please Help.

 

 

Thanks!

Respected Advisor
Posts: 2,855

Re: Sort Data ID's without deleting data columns

Posted in reply to marianthi86

@marianthi86 wrote:

Hi,

 

 

I have three data that i want to sort. DataA, DataB, and baseline

 

I used the following syntax:

data dataa;
  input ID @@;
  cards;
501 502 503 504 505 506 507 508 509 510
;
Data datab;
  input ID @@;
  cards;
501 502 503 504 505 506 507 508 509 510
;
data baseline;
  input ID @@;
  cards;
501 502 503 504 505 506 507 508 509 510 601 602 603 604 605
;

 

 

Resorting by ID was accomplished however all other columns from all three data were deleted. How can i resort my ID without deleting any columns?

 

Please Help.

 

 

Thanks!


How can we know what you are talking about if you don't give us the details???

 

There is no sorting done in your program.

--
Paige Miller
Super User
Posts: 13,365

Re: Sort Data ID's without deleting data columns

Posted in reply to marianthi86

What other columns? The data sets you show will only contain the variable ID.

Ask a Question
Discussion stats
  • 2 replies
  • 132 views
  • 0 likes
  • 3 in conversation