BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
TomHsiung
Pyrite | Level 9

Logs of PROC Tabulate

80   proc tabulate data = d202_raw;
81   title 'Summary of patient characterisitcs';
82   class AF gender smoker CHF DM Stroke Hypertension HFstage hypoalbuminemia RIFLE
83   indication1 CYP2C9 VKORC1
84   Amiodarone Heparin Statin Antiplatelets
85   ;
86   var ageY wt bsa followUp
87   alb1 alb2 alb3 alb4 alb5
88   ;
89   table
90   ageY
91   wt
92   bsa
93   followUp
94   alb1
95   alb2
96   alb3
97   alb4
98   alb5
99   , AF = 'Atrial fibrillation' * (N Mean STD Q1 Q3)
100  all = 'Overall' * (N Mean STD Q1 Q3);
101  table
102  gender
103  smoker
104  CHF
105  DM
106  Stroke
107  Hypertension
108  HFstage
109  hypoalbuminemia
110  RIFLE
111  indication1
112  CYP2C9
113  VKORC1
114  Amiodarone
115  Heparin
116  Statin
117  Antiplatelets
118  , AF = 'Atrial fibrillation' * (N colpctn = '%')
119  all = 'Overall' * (N colpctn = '%')
120  ;
121  run;
NOTE: There were 200 observations read from the data set WORK.D202_RAW.
NOTE: The PROCEDURE TABULATE printed pages 134-139.
NOTE: PROCEDURE TABULATE used (Total process time):
      real time           0.05 seconds
      user cpu time       0.05 seconds
      system cpu time     0.02 seconds
      memory              11064.26k
      OS Memory           55500.00k
      Timestamp           05/04/2025 06:42:43 PM
      Step Count                        204  Switch Count  0
      Page Faults                       0
      Page Reclaims                     2161
      Page Swaps                        0
      Voluntary Context Switches        614
      Involuntary Context Switches      0
      Block Input Operations            0
      Block Output Operations           616

 

The PROC Univariate could get the 200 observation. However, the PROC Tabulate only report the results of 199 observation. I don't know which observation was removed.

 

PROC Tabulate script:

 

proc tabulate data = d202_raw;
title 'Summary of patient characterisitcs';
class AF gender smoker CHF DM Stroke Hypertension HFstage hypoalbuminemia RIFLE
indication1 CYP2C9 VKORC1
Amiodarone Heparin Statin Antiplatelets
;
var ageY wt bsa followUp
alb1 alb2 alb3 alb4 alb5
;
table
ageY
wt
bsa
followUp
alb1
alb2
alb3
alb4
alb5
, AF = 'Atrial fibrillation' * (N Mean STD Q1 Q3)
all = 'Overall' * (N Mean STD Q1 Q3);
table
gender
smoker
CHF
DM
Stroke
Hypertension
HFstage
hypoalbuminemia
RIFLE
indication1
CYP2C9
VKORC1
Amiodarone
Heparin
Statin
Antiplatelets
, AF = 'Atrial fibrillation' * (N colpctn = '%')
all = 'Overall' * (N colpctn = '%')
;
run;

 

Log of PROC Univariate:

80   proc univariate data = d202_raw;
81   var ageY;
82   run;
NOTE: The PROCEDURE UNIVARIATE printed pages 140-141.
NOTE: PROCEDURE UNIVARIATE used (Total process time):
      real time           0.05 seconds
      user cpu time       0.05 seconds
      system cpu time     0.01 seconds
      memory              1701.81k
      OS Memory           47528.00k
      Timestamp           05/04/2025 06:46:08 PM
      Step Count                        209  Switch Count  0
      Page Faults                       0
      Page Reclaims                     57
      Page Swaps                        0
      Voluntary Context Switches        0
      Involuntary Context Switches      1
      Block Input Operations            0
      Block Output Operations           8

 

1 ACCEPTED SOLUTION

Accepted Solutions
TomHsiung
Pyrite | Level 9

I use the elimination method to exclude one variable at one time. Finally, I found the category variable of 'Heparin' has an observation with its value missing. I think it was the cause. I have to remove this category variable from the PROC Tabulate, because I am not able to access the original dataset now.

 

Screenshot of the original dataset.

 

Screenshot 2025-05-05 at 3.09.06 AM.png

View solution in original post

12 REPLIES 12
PaigeMiller
Diamond | Level 26

I'm really having trouble grasping the problem. You say "However, the PROC Tabulate only report the results of 199 observation" but clearly PROC TABULATE log indicates it used 200 observations.

 

Show us the entire log for PROC TABULATE.

 

--
Paige Miller
TomHsiung
Pyrite | Level 9
Thread updated. Thanks
PaigeMiller
Diamond | Level 26

@TomHsiung wrote:
Thread updated. Thanks

Question updated.

 

Do not dump large amounts of code or log without explaining the problem clearly.

 

Also please read clearly, I wanted to see the entire log for PROC TABULATE and not the rest of what you showed.

--
Paige Miller
TomHsiung
Pyrite | Level 9

The result of the PROC Tabulate only counted 199 observations. See the screenshot.

 

Screenshot 2025-05-05 at 2.51.38 AM.png

PaigeMiller
Diamond | Level 26

Hello

 

I am going to request you provide the information in a new thread, I want to the entire code for PROC TABULATE as it appears in the log and NOT all that other stuff in the log you showed us (please read carefully). Then I want to see the output table. If you provide this properly, I won't have to scroll upwards 12 screens so I can see the code and then scroll downwards 12 screens to see the output, as I do now.

--
Paige Miller
TomHsiung
Pyrite | Level 9
Hi, Miller

Thanks for the tip. But except for the SAS Viya for learners web interface log tab, where else should I seek for the detail logs of PROC Tabulate?
TomHsiung
Pyrite | Level 9

I use the elimination method to exclude one variable at one time. Finally, I found the category variable of 'Heparin' has an observation with its value missing. I think it was the cause. I have to remove this category variable from the PROC Tabulate, because I am not able to access the original dataset now.

 

Screenshot of the original dataset.

 

Screenshot 2025-05-05 at 3.09.06 AM.png

TomHsiung
Pyrite | Level 9

Issue resolved, the cause confirmed by this screenshot of PROC Tabulate. Thanks everyone for the help.

 

Screenshot 2025-05-05 at 3.13.33 AM.png

PaigeMiller
Diamond | Level 26

@TomHsiung 

You are constantly changing the first post, and so the discussion becomes unintelligible. Please don't do that in the future. If you need to change or add something, change it by adding another post to the thread.

--
Paige Miller
TomHsiung
Pyrite | Level 9
Thanks for your attention to my thread. I will check the log before posting next time.
PaigeMiller
Diamond | Level 26

@TomHsiung wrote:

Thanks for the tip. But except for the SAS Viya for learners web interface log tab, where else should I seek for the detail logs of PROC Tabulate?

Really unclear what you are asking for. I want the entire log for PROC TABULATE, and not the other stuff that appears in the log before or after PROC TABULATE.

--
Paige Miller
Kathryn_SAS
SAS Employee

I realize there is already a solution for this, but the reason for the difference is the use of Class variables in PROC TABULATE. If any of the variables on the Class statement have a missing value, regardless of whether they are used in the TABLE statement, then those observations will be excluded from analysis. You can add the MISSING option to the PROC TABULATE statement to include those observations and see where the missing values exist:

proc tabulate data=d202_raw MISSING;

 

In your PROC UNIVARIATE code, you are only using a VAR statement, so all observations are included in the analysis.

sas-innovate-white.png

Missed SAS Innovate in Orlando?

Catch the best of SAS Innovate 2025 — anytime, anywhere. Stream powerful keynotes, real-world demos, and game-changing insights from the world’s leading data and AI minds.

 

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
  • 12 replies
  • 873 views
  • 3 likes
  • 3 in conversation