Programming the statistical procedures from SAS

proc tabulate

Reply
Contributor
Posts: 45

proc tabulate

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

Super Contributor
Posts: 1,636

Re: proc tabulate

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

Contributor
Posts: 45

proc tabulate

no, i need to subtract:   payment-costprice

Grand Advisor
Posts: 16,874

Re: proc tabulate

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.

Contributor
Posts: 45

Re: proc tabulate

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

Grand Advisor
Posts: 16,874

Re: proc tabulate

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

Contributor
Posts: 45

proc tabulate

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

Ask a Question
Discussion stats
  • 6 replies
  • 102 views
  • 0 likes
  • 3 in conversation