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 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

From SAS Users blog
Want more? Visit our blog for more articles like these.
5 Steps to Your First Analytics Project Using SAS

For SAS newbies, this video is a great way to get started. James Harroun walks through the process using SAS Studio for SAS OnDemand for Academics, but the same steps apply to any analytics project.

Find more tutorials on the SAS Users YouTube channel.

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