BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
kcvaldez98
Obsidian | Level 7

Hi SAS coders,

 

I am trying to do a PROC REPORT and ran into this error: " ERROR 79-322: Expecting a CONTENTS."

 

My code is 

PROC REPORT DATA = HYPANL.HYPANALYSIS1_20231116 SPLIT = '/';
COLUMNRaceCd N SBP DBP;
DEFINETxNm/ 'Race Code';
DEFINEN/ GROUP;
DEFINESBP/ ANALYSIS MEAN FORMAT = 4.1 'MEAN';
DEFINESBP/ STD = 'STD';
DEFINEDBP/ ANALYSIS MEAN FORMAT = 4.1 'MEAN';
DEFINE  DBP / STD = 'STD';
RUN;
 
I attached a ss to show where it says the error. Screen Shot 2023-11-20 at 9.01.21 AM.png

 I don't know what this error means. 

1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User

As posted, your code can't work, as yo have no blanks separating the statements (COLUMN or DEFINE) from the variable names.

Next, you have a variable in COLUMN for which no DEFINE exists, and a DEFINE for a variable not included in COLUMN.

Finally, the only options in a DEFINE statement which have an equal sign are COLOR and CONTENTS. Labels are given as quoted strings without an equal sign. To display multiple statistics for a single variable, define the statistics in the COLUMN statement.

proc report data=HYPANL.HYPANALYSIS1_20231116 split='/';
column TxNm N SBP,(mean std) DBP,(mean std);
define TxNm / 'Race Code';
define N / group;
define SBP / analysis;
define DBP / analysis;
run;

For detailed help, post example data in a DATA step with DATALINES; and the expected result from this.

View solution in original post

3 REPLIES 3
Kurt_Bremser
Super User

As posted, your code can't work, as yo have no blanks separating the statements (COLUMN or DEFINE) from the variable names.

Next, you have a variable in COLUMN for which no DEFINE exists, and a DEFINE for a variable not included in COLUMN.

Finally, the only options in a DEFINE statement which have an equal sign are COLOR and CONTENTS. Labels are given as quoted strings without an equal sign. To display multiple statistics for a single variable, define the statistics in the COLUMN statement.

proc report data=HYPANL.HYPANALYSIS1_20231116 split='/';
column TxNm N SBP,(mean std) DBP,(mean std);
define TxNm / 'Race Code';
define N / group;
define SBP / analysis;
define DBP / analysis;
run;

For detailed help, post example data in a DATA step with DATALINES; and the expected result from this.

kcvaldez98
Obsidian | Level 7

Thank you so much!

 

Some data and expected results is this:

 

DATA = 

RaceCd, SBP, DBP

 
B16165
B16078
O16870
W17673
W15965

 

My outcome should look like this minus the actual numbers since I am only providing you a fraction of the dataset that I am working with.

 

Screen Shot 2023-11-20 at 9.33.22 AM.png

Thank you, again!

Kurt_Bremser
Super User

See this:

proc format;
value $rcd
  "B" = "Black"
  "O" = "Other"
  "W" = "White"
;
run;

data have;
input RaceCd :$1. SBP DBP;
label
  RaceCd = "Race Code"
  SBP = "Systolic"
  DBP  = "Diastolic"
;
format RaceCd $rcd.;
datalines; 
B 161 65
B 160 78
O 168 70
W 176 73
W 159 65
;

proc report data=have;
column RaceCd n ("Average Presures" SBP,(mean std) DBP,(mean std));
define RaceCd / group;
define N / "N";
define SBP / analysis;
define DBP / analysis;
rbreak after / summarize;
run;

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 868 views
  • 0 likes
  • 2 in conversation