08-04-2014 04:32 PM
I think this might be easy but I am having problems generating the report,
I have a data quality report dataset A with vars
field_name Pcnt_Complete Faclity_name,
Age 100(20%) Facility1
Age 40(10%) Facility2
DOB 10(5%) Facility1
DOB 10(5%) Facility2
I want a report using proc report/proc tabulate like this
Facility_name Age DOB
Facility1 100(20%) 10(5%)
Facility2 40(10%) 10(5%)
I have tried several approaches in proc report but I am getting 1's in the cells and the values as column names.
Thanks in advance.
08-04-2014 07:09 PM
Does your Pcnt_Complet variable have a string value such as 100(20%) OR is it two separate numeric that you want to appear that way in the table?
If strings you are likely getting a count of 1 because there is only one of each combination
Did you generate this data or was it provided? If you generated it then it may be better to go back a few steps and avoid this one?
08-04-2014 11:23 PM
If your data is without (%) in Pcnt_Complete then desired output can be generated as
input field_name $ Pcnt_Complete Faclity_name $12.;
Age 100 Facility1
Age 40 Facility2
DOB 10 Facility1
DOB 10 Facility2
proc tabulate data=have;
class field_name Faclity_name;
table Faclity_name,Pcnt_Complete*field_name=' '*sum=' ';
08-05-2014 08:37 AM
data have; input (field_name Pcnt_Complete Faclity_name) ( : $40.); cards; Age 100(20%) Facility1 Age 40(10%) Facility2 DOB 10(5%) Facility1 DOB 10(5%) Facility2 ; run; proc report data=have nowd; columns Faclity_name Pcnt_Complete,field_name ; define Faclity_name/group; define Pcnt_Complete/group; define field_name/across ' ' ; run;
08-05-2014 08:54 AM
How would you then get two separate programmers to QC the output? My opinion is the data should reflect the output as much as possible so a proc compare can be done hence get the data looking like the output then minimal information in the report, then maybe a cosmetic view of the output for review. Of course if you don't need to validate it then this is irrelevant.