BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Martinez77
Fluorite | Level 6

Hey all,

So I would like to get rid of or edit the border at the top of my proc tabulate tables. It is only a problem when their is a variable to page break on.

also I would like to add a simple subtraction computation for example income1-income2 =difference.

Thanks

Here is an image:

Note the ugly bordering that is only on the page lable. It is make my template look horrible. Thanks

Martinez

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

Hi:

  Seeing all of your code and understanding your ODS destination will be important information for anyone to help you.

  However, you also have a different challenge. You said that

"I would like to add a simple subtraction computation for example income1-income2 =difference"   However, only PROC REPORT has a COMPUTE block which allows you to perform computations such as you describe. PROC REPORT can produce the same set of statistics as TABULATE, except for a few, so depending on your desired statistics, you should be able to switch to PROC REPORT fairly easily.

  But, again, seeing ALL of your code and knowing your destination would make it easier for someone to point you to a solution. It looks like you are getting simple counts. So it should not be hard to move to REPORT. Depending on your destination, if you do NOT need to compute a new column, then you might want to work with Tech Support on your border issue. It might be a problem with your code or your destination.

cynthia

View solution in original post

5 REPLIES 5
Cynthia_sas
SAS Super FREQ

Hi:

  Seeing all of your code and understanding your ODS destination will be important information for anyone to help you.

  However, you also have a different challenge. You said that

"I would like to add a simple subtraction computation for example income1-income2 =difference"   However, only PROC REPORT has a COMPUTE block which allows you to perform computations such as you describe. PROC REPORT can produce the same set of statistics as TABULATE, except for a few, so depending on your desired statistics, you should be able to switch to PROC REPORT fairly easily.

  But, again, seeing ALL of your code and knowing your destination would make it easier for someone to point you to a solution. It looks like you are getting simple counts. So it should not be hard to move to REPORT. Depending on your destination, if you do NOT need to compute a new column, then you might want to work with Tech Support on your border issue. It might be a problem with your code or your destination.

cynthia

Martinez77
Fluorite | Level 6

Cynthia,

Yes I figured out the ods issue. I just added the / box =_page_ and it resolved the problem for now.

As far as proc report goes I have never used it. Could you show me some example code of proc report that would reflect a proc tabulate output.

My boss just asked me about it recently so still waiting to hear back from him on specific variables.

I guess and example would be income1 -income2 =difference all showing in columns

Thank you,

Martinez

Martinez77
Fluorite | Level 6

Cynthia,

This is the simple code that is trying to be executed after bringing in a data set.

I hope this helps clarify

Proc tabulate data=simsterm;

CLASS GENDER

VAR CUM_GPA CUR_GPA;

TABLE GENDER, CUM_GPA CUR_GPA DIFF=(CUM_GPA – CUR_GPA);

RUN;


Thanks

Cynthia_sas
SAS Super FREQ

Hi:

  Your code: DIFF=(CUM_GPA-CUR_GPA) is not valid TABULATE syntax. So that is not going to work. In addition, you referred to BOX=_PAGE_, which indicates a 3 dimensional table, but in your posted code, you only have ROW and COL dimensions, you don't have a PAGE dimension. So are you asking about a different TABULATE than you originally posted?

  Also, I don't see any specification for TOTAL, such as you showed in your original screen shot. Do you have ANY working code with TABULATE? for the GPA example? Where is your BOX=_PAGE_ code? You also did not say what you were using for your destination of interest - -is it HTML, RTF, PDF???? What is your complete ODS statement?

  In addition, with this new TABULATE that you show, you will get the SUM statistic by default for CUR_GPA and CUM_GPA -- is that what you want? The sum of all these values for each gender???? Or do you want the average??? Have you pre-computed the CUR and CUM values?

  You asked for some sample PROC REPORT code. There are a lot of examples in the doc and in previous forum postings. Without seeing your data and your WORKING code (you also need a semi-colon at the end of your CLASS statement for this newly posted code to work) for this new example, it's hard to come up with a specific example.

cynthia

Martinez77
Fluorite | Level 6

Cynthia,

You gave me enough information to read and figure it out via research.

Thank you so much,

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 Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 932 views
  • 0 likes
  • 2 in conversation