BookmarkSubscribeRSS Feed
devarayalu
Fluorite | Level 6

data two;

input Name $20. Number $22-34;

Last=scan(name, -1);

cards;

Jeff W. Snoker          (908)782-4382

Raymond Albert          (732)235-4444

Alfred Edward Newman (800)123-4321

Steven J. Foster      (201)567-9876

Jose Romerez          (516)593-2377

;

proc report data=two nowd;

column name Number last;

define last / order noprint;

define number/ 'Phone Number' ;

run;

This is the code for report in Ascending order of last variable. But I want the Names and Phone Numbers in descending Alphabetical Order by Last Name.

Can any one help?

3 REPLIES 3
ScottBass
Rhodochrosite | Level 12

define last / order descending noprint;

http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#a002473627.htm, scroll to ORDER option.


Please post your question as a self-contained data step in the form of "have" (source) and "want" (desired results).
I won't contribute to your post if I can't cut-and-paste your syntactically correct code into SAS.
devarayalu
Fluorite | Level 6

Thank you for the prompt answer.

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

How to choose a machine learning algorithm

Use this tutorial as a handy guide to weigh the pros and cons of these commonly used machine learning algorithms.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 2823 views
  • 0 likes
  • 3 in conversation