BookmarkSubscribeRSS Feed
clcl
Calcite | Level 5

cant seem to get this to work .. tried a few different ways and get get different errors .

452  proc tabulate data=q2;

453  class country;

454  var parcid payment costprice;

455

456  table country all,

457      parcid*n

458      payment*sum

459      costprice*sum

460      payment-costprice*sum;

                -

                22

                 ---------

                 202

ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, ;, (, *, ',',

              /, <, =, [, {.

ERROR 202-322: The option or parameter is not recognized and will be ignored.

461

6 REPLIES 6
Linlin
Lapis Lazuli | Level 10

Hi,

Is this helpful?

proc tabulate data=sashelp.class;

class sex;

var height weight age;

table (sex all)*(height weight age)*(sum n);

run;

Linlin

clcl
Calcite | Level 5

no, i need to subtract:   payment-costprice

Reeza
Super User

I don't think you can do that in proc tabulate, ie create a new variable, you'll need either proc report or a datastep.

I typically prefer a datastep but it's up to you.

clcl
Calcite | Level 5

i also dont think you can . but my prof. taught us today that you can, but his example does not work ....

Reeza
Super User

Then ask your prof to clarify Smiley Happy or call Tech Support, they'll know the answer immediately.

clcl
Calcite | Level 5

FYI- you were correct !  

shame that when i said it in class he did not listen to me . have a good day and thanks !   CL

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 6 replies
  • 1332 views
  • 0 likes
  • 3 in conversation