Building models with SAS Enterprise Miner, SAS Factory Miner, SAS Visual Data Mining and Machine Learning or just with programming

How can we order the population in Ascending order in the following proc report step?

Reply
Contributor
Posts: 49

How can we order the population in Ascending order in the following proc report step?

Q1.  How can we order the population in Ascending order in the following proc report step?

Q2.  Why the format option is not working in the following define statement in proc report step?

data one;

  input Name $1-19    Capital    $21-35 Population    Area    Continent $57-71 UNDate;

  cards;

Afghanistan            Kabul            17070323    251825    Asia            1946

Albania                Tirane            3407400        11100    Europe            1955

Algeria                Algiers            28171132    919595    Africa            1962

Andorra                Andorra la Vell    64634        200        Europe            1993

Angola                Luanda            9901050        481300    Africa            1976

Antigua and Barbuda    St. John’s        65644        171        Central America    1981

Argentina            Buenos Aires    34248705    1073518    South America    1945

Armenia                Yerevan            3556864        11500    Asia            1992

Australia            Canberra        18255944    2966200    Australia        1945

Austria                Vienna            8033746        32400    Europe            1955

Azerbaijan            Baku            7760064        33400    Asia            1992

Bahamas                Nassau            275703        5400    Central America    1973

Bahrain                Manama            591800        300        Asia            1971

Bangladesh            Dhaka            1.26E+08    57300    Asia            1974

Barbados            Bridgetown        258534        200        Central America    1966

proc print;

run;

proc report data=one nowd headline ;

  column continent population, sum;

  define continent / group;

  define population / 'TotPop' format=comma15.;

  where Population gt 1000000;

run;

Super Contributor
Posts: 349

Re: How can we order the population in Ascending order in the following proc report step?

Hi,

Try this..hope it helps..

proc report data=one nowd headline ;

  column continent population;

  define continent / group;

  define population / 'TotPop'  order format=comma15.;

  where Population gt 1000000;

run;

Thanks,

Shiva

Contributor
Posts: 49

Re: How can we order the population in Ascending order in the following proc report step?

Sorry this is not working and summing of population also not happening

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