I have tried various ways to make this output right but just not quite there with how I am doing my location, procedure, etc.
proc report nowd data=cardiac.tinrestudyfinal (where =(prov_tin = &prov_tin));
title1 'Provider TIN Level Restudy and PCI Redo Procedure Breakouts';
title2 'By Place of Service';
column ('Cardiac Metric Component' table)
('Calculation by Place of Service and Procedure' procedure location)
location procedure fakevar;
define prov_tin / group ' ' Noprint ;
define table / group ' ' order=formatted;
define location / across ' ' order=formatted;
define procedure / across ' ' style(column)={just=r};
define fakevar/ computed noprint;
compute fakevar;
fakevar=1;
endcomp;
run;
ods rtf close;
One example of the table looks like this. There could be other procedures. These are the other possible procedures that could be in the output. cath ct prt perf tee tte secho cabg pci stemi nstemi. But, this particular tin has only pci cath perf and tte. I pasted below what the output has to look like.
PROV_TIN | sub_table | table | PROCEDURE | LOCATION |
12 | IP182PCI | 1-182 PCI REDO RATE | PCI | INPATIENT |
12 | OP182PCI | 1-182 PCI REDO RATE | PCI | OUTPATIENT |
12 | OP182PCI | 1-182 PCI REDO RATE | PCI | OUTPATIENT |
12 | OP30PCI | 1-30 PCI REDO RATE | PCI | OUTPATIENT |
12 | IP30PCI | 1-30 PCI REDO RATE | PCI | INPATIENT |
12 | OP30PCI | 1-30 PCI REDO RATE | PCI | OUTPATIENT |
12 | IPMAJCATH | 3MTH MAJOR RESTUDY RATE | CATH | INPATIENT |
12 | OPMAJCATH | 3MTH MAJOR RESTUDY RATE | CATH | OUTPATIENT |
12 | OFCMAJPERF | 3MTH MAJOR RESTUDY RATE | PERF | OFFICE/CLINIC |
12 | OFCMAJPERF | 3MTH MAJOR RESTUDY RATE | PERF | OFFICE/CLINIC |
12 | OFCMINTTE | 3MTH MINOR RESTUDY RATE | TTE | OFFICE/CLINIC |
12 | OFCMINTTE | 3MTH MINOR RESTUDY RATE | TTE | OFFICE/CLINIC |
12 | IPMINTTE | 3MTH MINOR RESTUDY RATE | TTE | INPATIENT |
12 | OFCMINTTE | 3MTH MINOR RESTUDY RATE | TTE | OFFICE/CLINIC |
Cardiac Metric Component | Calculation by Place of Service and Procedure | ||||||
INPATIENT | OUTPATIENT | OFFICE/CLINIC | |||||
CATH | TTE | PCI | CATH | PCI | PERF | TTE | |
1-182 DAY PCI REDO RATE | 1 | 2 | |||||
1-30 DAY PCI REDO RATE | 1 | 2 | |||||
3-MONTH MAJOR RESTUDY RATE | 1 | 1 | 2 | 2 | |||
3-MONTH MINOR RESTUDY RATE | 1 | 3 |
The format of the wanted output is not quite right on the screen so attaching it.
Just a few things need to be changed in your column statements. Also, you don't need to define the prov_tin variable since you haven't included it in your desired output . . . see changes below . . .
proc report . . . more of your code . . .;
column ('Cardiac Metric Component' table)
('Calculation by Place of Service and Procedure' location )
, procedure fakevar;
define table / group ' ' order=formatted;
define location / across ' ' order=formatted;
define procedure / across ' ' style(column)={just=r};
define fakevar/ computed noprint;
compute fakevar;
fakevar=1;
endcomp;
run;
The spanned headings will probably create undesirable looking blank cells. You can eliminate those using style options. Some examples here: http://support.sas.com/resources/papers/proceedings11/246-2011.pdf
Just a few things need to be changed in your column statements. Also, you don't need to define the prov_tin variable since you haven't included it in your desired output . . . see changes below . . .
proc report . . . more of your code . . .;
column ('Cardiac Metric Component' table)
('Calculation by Place of Service and Procedure' location )
, procedure fakevar;
define table / group ' ' order=formatted;
define location / across ' ' order=formatted;
define procedure / across ' ' style(column)={just=r};
define fakevar/ computed noprint;
compute fakevar;
fakevar=1;
endcomp;
run;
The spanned headings will probably create undesirable looking blank cells. You can eliminate those using style options. Some examples here: http://support.sas.com/resources/papers/proceedings11/246-2011.pdf
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.