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
I don't know what this error means.
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.
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.
Thank you so much!
Some data and expected results is this:
DATA =
RaceCd, SBP, DBP
| B | 161 | 65 |
| B | 160 | 78 |
| O | 168 | 70 |
| W | 176 | 73 |
| W | 159 | 65 |
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.
Thank you, again!
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;
Nearly 200 sessions are now available on demand with the SAS Innovate Digital Pass.
Explore Now →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.