BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
data_null__
Jade | Level 19

Why are you using order=data?

 

Without a working example (like the one I wrote for you) I cannot help you debug your program.  Working means includes DATA.

 

 

DavidPhillips2
Rhodochrosite | Level 12

 


data all;
infile datalines DLM=',';
input GENDER $ residency_desc : $20. schev_ethnicity_desc $ ACADEMIC_PERIOD_DESC : $20. n
growthDeclineColumn perGrowthDeclineColumn lastGender lastResidency_desc lastSchev_ethnicity_desc ;
datalines;
Female,In-state,1,Fall 2015,1,0,0,0,0,1
Female,In-state,2,Fall 2015,47,0,0,0,0,1
Female,In-state,3,Fall 2015,18,0,0,0,0,1
Female,In-state,5,Fall 2015,20,0,0,0,0,1
Female,In-state,6,Fall 2015,30,0,0,0,0,1
Female,In-state,8,Fall 2015,230,0,0,0,0,1
Female,In-state,9,Fall 2015,3,0,0,0,0,1
Female,In-state,10,Fall 2015,6,0,0,0,0,1
Female,In-state,99,Fall 2015,355,0,0,0,1,1
Female,Out-of-state,2,Fall 2015,21,0,0,0,0,1
Female,Out-of-state,3,Fall 2015,13,0,0,0,0,1
Female,Out-of-state,5,Fall 2015,6,0,0,0,0,1
Female,Out-of-state,6,Fall 2015,11,0,0,0,0,1
Female,Out-of-state,8,Fall 2015,72,0,0,0,0,1
Female,Out-of-state,9,Fall 2015,10,0,0,0,0,1
Female,Out-of-state,99,Fall 2015,133,0,0,0,1,1
Female,Total,1,Fall 2015,1,0,0,0,0,1
Female,Total,2,Fall 2015,68,0,0,0,0,1
Female,Total,3,Fall 2015,31,0,0,0,0,1
Female,Total,5,Fall 2015,26,0,0,0,0,1
Female,Total,6,Fall 2015,41,0,0,0,0,1
Female,Total,8,Fall 2015,302,0,0,0,0,1
Female,Total,9,Fall 2015,13,0,0,0,0,1
Female,Total,10,Fall 2015,6,0,0,0,0,1
Female,Total,99,Fall 2015,488,0,0,0,0,0
Female,Total,99,Fall 2015,488,0,0,1,1,1
Male,In-state,1,Fall 2015,1,0,0,0,0,1
Male,In-state,2,Fall 2015,23,0,0,0,0,1
Male,In-state,3,Fall 2015,10,0,0,0,0,1
Male,In-state,5,Fall 2015,6,0,0,0,0,1
Male,In-state,6,Fall 2015,14,0,0,0,0,1
Male,In-state,8,Fall 2015,87,0,0,0,0,1
Male,In-state,9,Fall 2015,1,0,0,0,0,1
Male,In-state,10,Fall 2015,3,0,0,0,0,1
Male,In-state,99,Fall 2015,145,0,0,0,1,1
Male,Out-of-state,2,Fall 2015,4,0,0,0,0,1
Male,Out-of-state,3,Fall 2015,2,0,0,0,0,1
Male,Out-of-state,5,Fall 2015,1,0,0,0,0,1
Male,Out-of-state,6,Fall 2015,2,0,0,0,0,1
Male,Out-of-state,8,Fall 2015,16,0,0,0,0,1
Male,Out-of-state,9,Fall 2015,3,0,0,0,0,1
Male,Out-of-state,99,Fall 2015,28,0,0,0,1,1
Male,Total,1,Fall 2015,1,0,0,0,0,1
Male,Total,2,Fall 2015,27,0,0,0,0,1
Male,Total,3,Fall 2015,12,0,0,0,0,1
Male,Total,5,Fall 2015,7,0,0,0,0,1
Male,Total,6,Fall 2015,16,0,0,0,0,1
Male,Total,8,Fall 2015,103,0,0,0,0,1
Male,Total,9,Fall 2015,4,0,0,0,0,1
Male,Total,10,Fall 2015,3,0,0,0,0,1
Male,Total,99,Fall 2015,173,0,0,0,0,0
Male,Total,99,Fall 2015,173,0,0,1,1,1
Total,In-state,1,Fall 2015,2,0,0,0,0,1
Total,In-state,2,Fall 2015,70,0,0,0,0,1
Total,In-state,3,Fall 2015,28,0,0,0,0,1
Total,In-state,5,Fall 2015,26,0,0,0,0,1
Total,In-state,6,Fall 2015,44,0,0,0,0,1
Total,In-state,8,Fall 2015,317,0,0,0,0,1
Total,In-state,9,Fall 2015,4,0,0,0,0,1
Total,In-state,10,Fall 2015,9,0,0,0,0,1
Total,In-state,99,Fall 2015,500,0,0,0,1,1
Total,Out-of-state,2,Fall 2015,25,0,0,0,0,1
Total,Out-of-state,3,Fall 2015,15,0,0,0,0,1
Total,Out-of-state,5,Fall 2015,7,0,0,0,0,1
Total,Out-of-state,6,Fall 2015,13,0,0,0,0,1
Total,Out-of-state,8,Fall 2015,88,0,0,0,0,1
Total,Out-of-state,9,Fall 2015,13,0,0,0,0,1
Total,Out-of-state,99,Fall 2015,161,0,0,0,1,1
Total,Total,1,Fall 2015,2,0,0,0,0,1
Total,Total,2,Fall 2015,95,0,0,0,0,1
Total,Total,3,Fall 2015,43,0,0,0,0,1
Total,Total,5,Fall 2015,33,0,0,0,0,1
Total,Total,6,Fall 2015,57,0,0,0,0,1
Total,Total,8,Fall 2015,405,0,0,0,0,1
Total,Total,9,Fall 2015,17,0,0,0,0,1
Total,Total,10,Fall 2015,9,0,0,0,0,1
Total,Total,99,Fall 2015,661,0,0,0,0,0
Total,Total,99,Fall 2015,661,0,0,1,1,1
;

 

proc report data=all;

column (lastGender lastResidency_desc lastSchev_ethnicity_desc gender residency_desc schev_ethnicity_desc academic_period_desc, n);

define gender / group '' order=data;
define residency_desc / group '' order=data;
define schev_ethnicity_desc / group '' order=internal;

define lastGender / order=internal;
define lastResidency_desc / order=internal;
define lastSchev_ethnicity_desc / order=internal;

define academic_period_desc / across '';
define n / analysis sum '';

/*compute after residency_desc / style=[background=blue];
x = ' ';
if lastGender eq 1 then lastResidency_desc =0;
line x $varying1. lastResidency_desc;
endcomp; */

run;

data_null__
Jade | Level 19

I changed the data type on SCHEV_ETHNICITY_DESC I don't think this can work with order=data.  I don't understand the extra rows of total 99.  I think it's close.

Capture.PNG

 

 

data all;
infile datalines DLM=',';
input GENDER $ residency_desc : $20. schev_ethnicity_desc ACADEMIC_PERIOD_DESC : $20. n
growthDeclineColumn perGrowthDeclineColumn lastGender lastResidency_desc lastSchev_ethnicity_desc ;
datalines;
Female,In-state,1,Fall 2015,1,0,0,0,0,1
Female,In-state,2,Fall 2015,47,0,0,0,0,1
Female,In-state,3,Fall 2015,18,0,0,0,0,1
Female,In-state,5,Fall 2015,20,0,0,0,0,1
Female,In-state,6,Fall 2015,30,0,0,0,0,1
Female,In-state,8,Fall 2015,230,0,0,0,0,1
Female,In-state,9,Fall 2015,3,0,0,0,0,1
Female,In-state,10,Fall 2015,6,0,0,0,0,1
Female,In-state,99,Fall 2015,355,0,0,0,1,1
Female,Out-of-state,2,Fall 2015,21,0,0,0,0,1
Female,Out-of-state,3,Fall 2015,13,0,0,0,0,1
Female,Out-of-state,5,Fall 2015,6,0,0,0,0,1
Female,Out-of-state,6,Fall 2015,11,0,0,0,0,1
Female,Out-of-state,8,Fall 2015,72,0,0,0,0,1
Female,Out-of-state,9,Fall 2015,10,0,0,0,0,1
Female,Out-of-state,99,Fall 2015,133,0,0,0,1,1
Female,Total,1,Fall 2015,1,0,0,0,0,1
Female,Total,2,Fall 2015,68,0,0,0,0,1
Female,Total,3,Fall 2015,31,0,0,0,0,1
Female,Total,5,Fall 2015,26,0,0,0,0,1
Female,Total,6,Fall 2015,41,0,0,0,0,1
Female,Total,8,Fall 2015,302,0,0,0,0,1
Female,Total,9,Fall 2015,13,0,0,0,0,1
Female,Total,10,Fall 2015,6,0,0,0,0,1
Female,Total,99,Fall 2015,488,0,0,0,0,0
Female,Total,99,Fall 2015,488,0,0,1,1,1
Male,In-state,1,Fall 2015,1,0,0,0,0,1
Male,In-state,2,Fall 2015,23,0,0,0,0,1
Male,In-state,3,Fall 2015,10,0,0,0,0,1
Male,In-state,5,Fall 2015,6,0,0,0,0,1
Male,In-state,6,Fall 2015,14,0,0,0,0,1
Male,In-state,8,Fall 2015,87,0,0,0,0,1
Male,In-state,9,Fall 2015,1,0,0,0,0,1
Male,In-state,10,Fall 2015,3,0,0,0,0,1
Male,In-state,99,Fall 2015,145,0,0,0,1,1
Male,Out-of-state,2,Fall 2015,4,0,0,0,0,1
Male,Out-of-state,3,Fall 2015,2,0,0,0,0,1
Male,Out-of-state,5,Fall 2015,1,0,0,0,0,1
Male,Out-of-state,6,Fall 2015,2,0,0,0,0,1
Male,Out-of-state,8,Fall 2015,16,0,0,0,0,1
Male,Out-of-state,9,Fall 2015,3,0,0,0,0,1
Male,Out-of-state,99,Fall 2015,28,0,0,0,1,1
Male,Total,1,Fall 2015,1,0,0,0,0,1
Male,Total,2,Fall 2015,27,0,0,0,0,1
Male,Total,3,Fall 2015,12,0,0,0,0,1
Male,Total,5,Fall 2015,7,0,0,0,0,1
Male,Total,6,Fall 2015,16,0,0,0,0,1
Male,Total,8,Fall 2015,103,0,0,0,0,1
Male,Total,9,Fall 2015,4,0,0,0,0,1
Male,Total,10,Fall 2015,3,0,0,0,0,1
Male,Total,99,Fall 2015,173,0,0,0,0,0
Male,Total,99,Fall 2015,173,0,0,1,1,1
Total,In-state,1,Fall 2015,2,0,0,0,0,1
Total,In-state,2,Fall 2015,70,0,0,0,0,1
Total,In-state,3,Fall 2015,28,0,0,0,0,1
Total,In-state,5,Fall 2015,26,0,0,0,0,1
Total,In-state,6,Fall 2015,44,0,0,0,0,1
Total,In-state,8,Fall 2015,317,0,0,0,0,1
Total,In-state,9,Fall 2015,4,0,0,0,0,1
Total,In-state,10,Fall 2015,9,0,0,0,0,1
Total,In-state,99,Fall 2015,500,0,0,0,1,1
Total,Out-of-state,2,Fall 2015,25,0,0,0,0,1
Total,Out-of-state,3,Fall 2015,15,0,0,0,0,1
Total,Out-of-state,5,Fall 2015,7,0,0,0,0,1
Total,Out-of-state,6,Fall 2015,13,0,0,0,0,1
Total,Out-of-state,8,Fall 2015,88,0,0,0,0,1
Total,Out-of-state,9,Fall 2015,13,0,0,0,0,1
Total,Out-of-state,99,Fall 2015,161,0,0,0,1,1
Total,Total,1,Fall 2015,2,0,0,0,0,1
Total,Total,2,Fall 2015,95,0,0,0,0,1
Total,Total,3,Fall 2015,43,0,0,0,0,1
Total,Total,5,Fall 2015,33,0,0,0,0,1
Total,Total,6,Fall 2015,57,0,0,0,0,1
Total,Total,8,Fall 2015,405,0,0,0,0,1
Total,Total,9,Fall 2015,17,0,0,0,0,1
Total,Total,10,Fall 2015,9,0,0,0,0,1
Total,Total,99,Fall 2015,661,0,0,0,0,0
Total,Total,99,Fall 2015,661,0,0,1,1,1
;
 
proc report data=all list showall;
   column 
      (
         gender lastGender
         residency_desc lastResidency_desc
         lastSchev_ethnicity_desc schev_ethnicity_desc         
         academic_period_desc, n);
   define gender / group '';
   define residency_desc / group '';
   define schev_ethnicity_desc / group '' order=internal;
   define lastGender / order order=internal noprint;
   define lastResidency_desc / order order=internal noprint;
   define lastSchev_ethnicity_desc / order order=internal noprint;
   define academic_period_desc / across '';
   define n / analysis sum '';
   compute after lastResidency_desc / style={background=lightblue};
      x = ' ';
      if lastgender eq 1 then lastResidency_desc=0;
      line x $varying1. lastResidency_desc;
      endcomp; 
	compute after gender / style={background=blue};		
		line ' ';
		endcomp;
   run;
DavidPhillips2
Rhodochrosite | Level 12

How can I group the year column to show side by side?

 

data all;
infile datalines DLM=',';
input GENDER $ residency_desc : $20. schev_ethnicity_desc ACADEMIC_PERIOD_DESC : $20. n
growthDeclineColumn perGrowthDeclineColumn lastGender lastResidency_desc lastSchev_ethnicity_desc ;
datalines;
Female,In-state,1,Fall 2014,1,0,0,0,0,1
Female,In-state,2,Fall 2014,47,0,0,0,0,1
Female,In-state,3,Fall 2014,18,0,0,0,0,1
Female,In-state,5,Fall 2014,20,0,0,0,0,1
Female,In-state,6,Fall 2014,30,0,0,0,0,1
Female,In-state,8,Fall 2014,230,0,0,0,0,1
Female,In-state,9,Fall 2014,3,0,0,0,0,1
Female,In-state,10,Fall 2014,6,0,0,0,0,1
Female,In-state,99,Fall 2014,355,0,0,0,1,1
Female,Out-of-state,2,Fall 2014,21,0,0,0,0,1
Female,Out-of-state,3,Fall 2014,13,0,0,0,0,1
Female,Out-of-state,5,Fall 2014,6,0,0,0,0,1
Female,Out-of-state,6,Fall 2014,11,0,0,0,0,1
Female,Out-of-state,8,Fall 2014,72,0,0,0,0,1
Female,Out-of-state,9,Fall 2014,10,0,0,0,0,1
Female,Out-of-state,99,Fall 2014,133,0,0,0,1,1
Female,Total,1,Fall 2014,1,0,0,0,0,1
Female,Total,2,Fall 2014,68,0,0,0,0,1
Female,Total,3,Fall 2014,31,0,0,0,0,1
Female,Total,5,Fall 2014,26,0,0,0,0,1
Female,Total,6,Fall 2014,41,0,0,0,0,1
Female,Total,8,Fall 2014,302,0,0,0,0,1
Female,Total,9,Fall 2014,13,0,0,0,0,1
Female,Total,10,Fall 2014,6,0,0,0,0,1
Female,Total,99,Fall 2014,488,0,0,0,0,0
Female,Total,99,Fall 2014,488,0,0,1,1,1
Male,In-state,1,Fall 2014,1,0,0,0,0,1
Male,In-state,2,Fall 2014,23,0,0,0,0,1
Male,In-state,3,Fall 2014,10,0,0,0,0,1
Male,In-state,5,Fall 2014,6,0,0,0,0,1
Male,In-state,6,Fall 2014,14,0,0,0,0,1
Male,In-state,8,Fall 2014,87,0,0,0,0,1
Male,In-state,9,Fall 2014,1,0,0,0,0,1
Male,In-state,10,Fall 2014,3,0,0,0,0,1
Male,In-state,99,Fall 2014,145,0,0,0,1,1
Male,Out-of-state,2,Fall 2014,4,0,0,0,0,1
Male,Out-of-state,3,Fall 2014,2,0,0,0,0,1
Male,Out-of-state,5,Fall 2014,1,0,0,0,0,1
Male,Out-of-state,6,Fall 2014,2,0,0,0,0,1
Male,Out-of-state,8,Fall 2014,16,0,0,0,0,1
Male,Out-of-state,9,Fall 2014,3,0,0,0,0,1
Male,Out-of-state,99,Fall 2014,28,0,0,0,1,1
Male,Total,1,Fall 2014,1,0,0,0,0,1
Male,Total,2,Fall 2014,27,0,0,0,0,1
Male,Total,3,Fall 2014,12,0,0,0,0,1
Male,Total,5,Fall 2014,7,0,0,0,0,1
Male,Total,6,Fall 2014,16,0,0,0,0,1
Male,Total,8,Fall 2014,103,0,0,0,0,1
Male,Total,9,Fall 2014,4,0,0,0,0,1
Male,Total,10,Fall 2014,3,0,0,0,0,1
Male,Total,99,Fall 2014,173,0,0,0,0,0
Male,Total,99,Fall 2014,173,0,0,1,1,1
Total,In-state,1,Fall 2014,2,0,0,0,0,1
Total,In-state,2,Fall 2014,70,0,0,0,0,1
Total,In-state,3,Fall 2014,28,0,0,0,0,1
Total,In-state,5,Fall 2014,26,0,0,0,0,1
Total,In-state,6,Fall 2014,44,0,0,0,0,1
Total,In-state,8,Fall 2014,317,0,0,0,0,1
Total,In-state,9,Fall 2014,4,0,0,0,0,1
Total,In-state,10,Fall 2014,9,0,0,0,0,1
Total,In-state,99,Fall 2014,500,0,0,0,1,1
Total,Out-of-state,2,Fall 2014,25,0,0,0,0,1
Total,Out-of-state,3,Fall 2014,15,0,0,0,0,1
Total,Out-of-state,5,Fall 2014,7,0,0,0,0,1
Total,Out-of-state,6,Fall 2014,13,0,0,0,0,1
Total,Out-of-state,8,Fall 2014,88,0,0,0,0,1
Total,Out-of-state,9,Fall 2014,13,0,0,0,0,1
Total,Out-of-state,99,Fall 2014,161,0,0,0,1,1
Total,Total,1,Fall 2014,2,0,0,0,0,1
Total,Total,2,Fall 2014,95,0,0,0,0,1
Total,Total,3,Fall 2014,43,0,0,0,0,1
Total,Total,5,Fall 2014,33,0,0,0,0,1
Total,Total,6,Fall 2014,57,0,0,0,0,1
Total,Total,8,Fall 2014,405,0,0,0,0,1
Total,Total,9,Fall 2014,17,0,0,0,0,1
Total,Total,10,Fall 2014,9,0,0,0,0,1
Total,Total,99,Fall 2014,661,0,0,0,0,0


Female,In-state,1,Fall 2015,1,0,0,0,0,1
Female,In-state,2,Fall 2015,47,0,0,0,0,1
Female,In-state,3,Fall 2015,18,0,0,0,0,1
Female,In-state,5,Fall 2015,20,0,0,0,0,1
Female,In-state,6,Fall 2015,30,0,0,0,0,1
Female,In-state,8,Fall 2015,230,0,0,0,0,1
Female,In-state,9,Fall 2015,3,0,0,0,0,1
Female,In-state,10,Fall 2015,6,0,0,0,0,1
Female,In-state,99,Fall 2015,355,0,0,0,1,1
Female,Out-of-state,2,Fall 2015,21,0,0,0,0,1
Female,Out-of-state,3,Fall 2015,13,0,0,0,0,1
Female,Out-of-state,5,Fall 2015,6,0,0,0,0,1
Female,Out-of-state,6,Fall 2015,11,0,0,0,0,1
Female,Out-of-state,8,Fall 2015,72,0,0,0,0,1
Female,Out-of-state,9,Fall 2015,10,0,0,0,0,1
Female,Out-of-state,99,Fall 2015,133,0,0,0,1,1
Female,Total,1,Fall 2015,1,0,0,0,0,1
Female,Total,2,Fall 2015,68,0,0,0,0,1
Female,Total,3,Fall 2015,31,0,0,0,0,1
Female,Total,5,Fall 2015,26,0,0,0,0,1
Female,Total,6,Fall 2015,41,0,0,0,0,1
Female,Total,8,Fall 2015,302,0,0,0,0,1
Female,Total,9,Fall 2015,13,0,0,0,0,1
Female,Total,10,Fall 2015,6,0,0,0,0,1
Female,Total,99,Fall 2015,488,0,0,0,0,0
Female,Total,99,Fall 2015,488,0,0,1,1,1
Male,In-state,1,Fall 2015,1,0,0,0,0,1
Male,In-state,2,Fall 2015,23,0,0,0,0,1
Male,In-state,3,Fall 2015,10,0,0,0,0,1
Male,In-state,5,Fall 2015,6,0,0,0,0,1
Male,In-state,6,Fall 2015,14,0,0,0,0,1
Male,In-state,8,Fall 2015,87,0,0,0,0,1
Male,In-state,9,Fall 2015,1,0,0,0,0,1
Male,In-state,10,Fall 2015,3,0,0,0,0,1
Male,In-state,99,Fall 2015,145,0,0,0,1,1
Male,Out-of-state,2,Fall 2015,4,0,0,0,0,1
Male,Out-of-state,3,Fall 2015,2,0,0,0,0,1
Male,Out-of-state,5,Fall 2015,1,0,0,0,0,1
Male,Out-of-state,6,Fall 2015,2,0,0,0,0,1
Male,Out-of-state,8,Fall 2015,16,0,0,0,0,1
Male,Out-of-state,9,Fall 2015,3,0,0,0,0,1
Male,Out-of-state,99,Fall 2015,28,0,0,0,1,1
Male,Total,1,Fall 2015,1,0,0,0,0,1
Male,Total,2,Fall 2015,27,0,0,0,0,1
Male,Total,3,Fall 2015,12,0,0,0,0,1
Male,Total,5,Fall 2015,7,0,0,0,0,1
Male,Total,6,Fall 2015,16,0,0,0,0,1
Male,Total,8,Fall 2015,103,0,0,0,0,1
Male,Total,9,Fall 2015,4,0,0,0,0,1
Male,Total,10,Fall 2015,3,0,0,0,0,1
Male,Total,99,Fall 2015,173,0,0,0,0,0
Male,Total,99,Fall 2015,173,0,0,1,1,1
Total,In-state,1,Fall 2015,2,0,0,0,0,1
Total,In-state,2,Fall 2015,70,0,0,0,0,1
Total,In-state,3,Fall 2015,28,0,0,0,0,1
Total,In-state,5,Fall 2015,26,0,0,0,0,1
Total,In-state,6,Fall 2015,44,0,0,0,0,1
Total,In-state,8,Fall 2015,317,0,0,0,0,1
Total,In-state,9,Fall 2015,4,0,0,0,0,1
Total,In-state,10,Fall 2015,9,0,0,0,0,1
Total,In-state,99,Fall 2015,500,0,0,0,1,1
Total,Out-of-state,2,Fall 2015,25,0,0,0,0,1
Total,Out-of-state,3,Fall 2015,15,0,0,0,0,1
Total,Out-of-state,5,Fall 2015,7,0,0,0,0,1
Total,Out-of-state,6,Fall 2015,13,0,0,0,0,1
Total,Out-of-state,8,Fall 2015,88,0,0,0,0,1
Total,Out-of-state,9,Fall 2015,13,0,0,0,0,1
Total,Out-of-state,99,Fall 2015,161,0,0,0,1,1
Total,Total,1,Fall 2015,2,0,0,0,0,1
Total,Total,2,Fall 2015,95,0,0,0,0,1
Total,Total,3,Fall 2015,43,0,0,0,0,1
Total,Total,5,Fall 2015,33,0,0,0,0,1
Total,Total,6,Fall 2015,57,0,0,0,0,1
Total,Total,8,Fall 2015,405,0,0,0,0,1
Total,Total,9,Fall 2015,17,0,0,0,0,1
Total,Total,10,Fall 2015,9,0,0,0,0,1
Total,Total,99,Fall 2015,661,0,0,0,0,0

;

proc report data=all list showall;
column
(
gender lastGender
residency_desc lastResidency_desc
lastSchev_ethnicity_desc schev_ethnicity_desc
academic_period_desc, n);
define gender / group '';
define residency_desc / group '';
define schev_ethnicity_desc / group '' order=internal;
define lastGender / order order=internal noprint;
define lastResidency_desc / order order=internal noprint;
define lastSchev_ethnicity_desc / order order=internal noprint;
define academic_period_desc / group across '';
define n / analysis sum '';
compute after lastResidency_desc / style={background=lightblue};
x = ' ';
if lastgender eq 1 then lastResidency_desc=0;
line x $varying1. lastResidency_desc;
endcomp;
compute after gender / style={background=blue};
line ' ';
endcomp;
run;

data_null__
Jade | Level 19

Change all the ORDERs to GROUPs.  But I think it would be easier to create the LAST variables if you first transpose years to variables.

 

proc report data=all list;* showall;
   column
      (
         gender lastGender
         residency_desc lastResidency_desc
         lastSchev_ethnicity_desc schev_ethnicity_desc
         academic_period_desc, n
      );
   define gender / group ' ';
   define residency_desc / group ' ';
   define schev_ethnicity_desc / group ' ' order=internal;
   define lastGender / group order=internal noprint;
   define lastResidency_desc / group order=internal noprint;
   define lastSchev_ethnicity_desc / group order=internal noprint;
   define academic_period_desc /  across ' ';
   define n / analysis sum '';
   compute after lastResidency_desc / style={background=lightblue};
      x = ' ';
      if lastgender eq 1 then lastResidency_desc=0;
      line x $varying1. lastResidency_desc;
      endcomp;
   compute after gender / style={background=blue};
      line ' ';
      endcomp;
   run;

You're welcome.  

DavidPhillips2
Rhodochrosite | Level 12

Data_null_,

Thanks for your help on this it’s a learning curve figuring out proc report.

data_null__
Jade | Level 19

Search at http://lexjansen.com/ there are many good paper to explain how PROC REPORT works.

DavidPhillips2
Rhodochrosite | Level 12

I ended up:

Wrote a macro that converted my whole table to a number using informats.

Formatted all numbers to text when displaying.

Ordering all data by data=internal in proc report.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 22 replies
  • 4911 views
  • 1 like
  • 4 in conversation