Attached is an example of what the table looks like.
Attached is how I am trying to format the data to look on the output in an RTF. This is the request from management for how they want to see the output.
The code I have for the first output is correct and works and yes there is other code to define a bunch of other things:
DATA CARDIAC.REPORTING;SET CARDIAC.ALL_AGGREGATES;
IF STRATA=&PROV_TIN;*chng to &PROV_MPIN if doing MPIN report;
CATH_DEF=left((CATHS)||'/'||(left(mbr)));
PCI_DEF=left(PCIS||'/'||left(MBR));
SECHO_DEF=left(SECHO||'/'||left(MBR));
TEE_DEF=LEFT(TEE||'/'||LEFT(MBR));
TTE_DEF=LEFT(TTE||'/'||LEFT(MBR));
PET_DEF=LEFT(PET||'/'||LEFT(MBR));
PERF_DEF=left(PERFS||'/'||left(MBR));
CT_DEF=left(CTS||'/'||left(MBR));
CABG_DEF=left(CABGS||'/'||left(MBR));
MAJ_DEF=left(MAJ_RESTUDY||'/'||left(RESTUDY_DENOM));
MIN_DEF=left(MIN_RESTUDY||'/'||left(RESTUDY_DENOM));
REVASC_DEF=left(REVASCS||'/'||left(CATHS));
FU30_DEF=left(PCI_FU_30||'/'||left(FU30_DENOM));
FU182_DEF=left(PCI_FU_182||'/'||left(FU182_DENOM));
IMPPAC_DEF=left(IMPPACS||'/'||left(MBR));
OUTPT_DEF=LEFT(outpt_pci||'/'||LEFT(PCIS));
keep OUTPT_DEF strata cath_def pci_def secho_def pet_def tee_def tte_def perf_def ct_def cabg_def maj_def min_def revasc_def
fu30_def fu182_def IMPPAC_DEF ;
RUN;
My problem is how to breakout all the places of services and have it formatted like tab 2 of the worksheet. I tried this as an example but it does not work correctly and then how do I do all the breakouts so they run across like they are supposed to???
*pos breakouts;
DATA CARDIAC.pos_REPORTING;SET CARDIAC.pos_final;
IF STRATA=&PROV_TIN;*chng to &PROV_MPIN if doing MPIN report;
CATH_DEF=left((CATHS)||'/'|| (left(office_clinic)||'/'||(left(mbr)));
PCI_DEF=left(PCIS||'/'||(left(office_clinic)||'/'||left(MBR));
SECHO_DEF=left(SECHO||'/'||(left(office_clinic)||'/'||left(MBR));
PET_DEF=LEFT(PET||'/'||(left(office_clinic)||'/'||LEFT(MBR));
TEE_DEF=LEFT(TEE||'/'||(left(office_clinic)||'/'||LEFT(MBR));
TTE_DEF=LEFT(TTE||'/'||(left(office_clinic)||'/'||LEFT(MBR));
PERF_DEF=left(PERFS||'/'||(left(office_clinic)||'/'||left(MBR));
CT_DEF=left(CTS||'/'||(left(office_clinic)||'/'||left(MBR));
CABG_DEF=left(CABGS||'/'||(left(office_clinic)||'/'||left(MBR));
MAJ_DEF=left(MAJ_RESTUDY||'/'||(left(office_clinic)||'/'||left(RESTUDY_DENOM));
MIN_DEF=left(MIN_RESTUDY||'/'||(left(office_clinic)||'/'||left(RESTUDY_DENOM));
REVASC_DEF=left(REVASCS||'/'||(left(office_clinic)||'/'||left(CATHS));
FU30_DEF=left(PCI_FU_30||'/'||(left(office_clinic)||'/'||left(FU30_DENOM));
FU182_DEF=left(PCI_FU_182||'/'||(left(office_clinic)||'/'||left(FU182_DENOM));
IMPPAC_DEF=left(IMPPACS||'/'||(left(office_clinic)||'/'||left(MBR));
OUTPT_DEF=LEFT(outpt_pci||'/'||(left(office_clinic)||'/'||LEFT(PCIS));
keep OUTPT_DEF strata cath_def pci_def secho_def pet_def tee_def tte_def perf_def ct_def cabg_def maj_def min_def revasc_def
office_clinic fu30_def fu182_def IMPPAC_DEF ;
RUN;
One way to achieve it is by, seperating the counts of inpatient,outpatient and office into three different datasets and merging the three datasets by _name_, so we will get three columns in the same dataset.
Hope this helps
Thanks,
Jagadish
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.