DATA Step, Macro, Functions and more

Proc Sort

Accepted Solution Solved
Reply
Super Contributor
Posts: 1,040
Accepted Solution

Proc Sort


Hi Team,

I am sorting a dataset.

Proc sort dataset=ref.dname out=dname2;

run;

If i do like this will the original dataset will ever be disturbed????

Do i need to set it and then do the Sorting????

Regards


Accepted Solutions
Solution
‎12-06-2012 11:49 PM
PROC Star
Posts: 7,364

Re: Proc Sort

Your code (I would hope that you plan to include a by statement so that it sorts by one or more variables) won't alter ref.dname.

It will simply create a file called work.dname2 that looks like it the original, but sorted in whatever order you specify,

The only way I can think of where it would actually alter a file is if one used the old style macro code to rename work.dname2 to be referenced as ref.dname.  But, unless someone was really mischievousness (and old enough to know about old style macros), I can't imagine that happening.

View solution in original post


All Replies
Solution
‎12-06-2012 11:49 PM
PROC Star
Posts: 7,364

Re: Proc Sort

Your code (I would hope that you plan to include a by statement so that it sorts by one or more variables) won't alter ref.dname.

It will simply create a file called work.dname2 that looks like it the original, but sorted in whatever order you specify,

The only way I can think of where it would actually alter a file is if one used the old style macro code to rename work.dname2 to be referenced as ref.dname.  But, unless someone was really mischievousness (and old enough to know about old style macros), I can't imagine that happening.

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 1 reply
  • 149 views
  • 0 likes
  • 2 in conversation