I want to count the number of provider id numbers (CLM_RNDRG_PRVDR_NPI_NUM) that are associated with each level for HCPCS and SPECIALTY CODE. However, my output displays each provider ID (001 TO 020) across columns. After the "Allowed Units" column, I want the "Providers" column to count the number of providers for each HCPCS CODE.
proc tabulate data=&ds order=freq;
class clm_line_hcpcs_cd clm_rndrg_fed_prvdr_spclty_cd CLM_RNDRG_PRVDR_NPI_NUM;
var clm_line_alowd_chrg_amt clm_line_cvrd_pd_amt clm_line_prvdr_pmt_amt
CLM_LINE_ALOWD_UNIT_QTY;
table
/***Rows***/
clm_line_hcpcs_cd='HCPCS'
clm_rndrg_fed_prvdr_spclty_cd='SPECIALTY CODE'
,
/***Columns***/
all=''*(n='LINES'*format=comma30. pctn='%')
clm_line_alowd_unit_qty=''*(sum='Allowed Units'*format=comma30. pctsum='%')
CLM_RNDRG_PRVDR_NPI_NUM=''*(n='Providers'*format=comma30. colpctn='%')
clm_line_alowd_chrg_amt=''*(sum='Allowed Payments'*format=dollar30. pctsum='%')
clm_line_cvrd_pd_amt=''*(sum='Covered Payments'*format=dollar30. pctsum='%')
clm_line_prvdr_pmt_amt=''*(sum='Provider Payments'*format=dollar30. pctsum='%')
/misstext='0.00' row=float box='Lines and Payments by HCPCS & Specialty';
title1 'Line-Level Summary';
title2 'All Claims';
run;title;footnote;
HERE'S THE ERRONEOUS OUTPUT:
Line-Level Summary All Claims