Hello, I am working on creating a SAS code that will automate a report on Tuberculosis cases and contacts. I have some sample code that I have been working on but it is not looking how I the report looks. I have attached report that I am trying to create. I have also attached my SAS code so far. I can attach the dataset if someone needs it. options center ps=60 ls=120;
/************************************************************** */
/*File: AutoCode to convert Excel Data to SAS data set */
/*Date: 01/21/2016 */
/*Data: Data from C:\Users\Shaquina\ */
*/ AutoCode.xlsx */
*/Create: C:\Users\Shaquina\AutoCode.sas7bdat */
/****************************************************************/
;
* First: Import data using the import wizard
1. Save file to be imported as a CSV(MS-DOS) file.
2. In SAS, click on File, Import Data...
3. From the drop down menu, click on Comma Separated Values (*.csv).
4. Choose the file destination and click next.
5. Choose library and name the new sas file and click next.
6. Click finish.
7. Proc print data= XX.XXX (obs=5) *This will confirm you successfully uploaded the file**;
******************************************************************************************************;
libname Danielle 'C:\Users\Shaquina\';
Title color= black "Tuberculosis Control Program-Arkansas";
title2 color= black "Preliminary";
title3 color = black "Aggregate Reports for Tuberculosis Program Evaluation:";
title4 color = black "Follow-up and Treatment for Contacts to Tuberculosis Cases";
title5 color = black "Reporting Area AR0000";
title6 color = black "Cohort Year: 2014";
title7 color = black "Closure Date for Follow-up: 08/15/2015";
title8 color = black "Total TB Cases Reported: 93";
run;
footnote ' ';
*merging the data;
PROC PRINT data = Danielle.AutoCode1 (obs=5);
run;
proc print data = Danielle.AutoCode_2 (obs=5); run;
proc sort data=Danielle.Autocode1;
by StateCaseNo;
run;
proc sort data= Danielle.Autocode_2;
by StateCaseNo;
run;
data Danielle.AutoCodeAll_;
merge Danielle.AutoCode1 Danielle.AutoCode_2;
by StateCaseNo;
run;
proc print data = Danielle.AutoCodeAll (obs=5); run;
Data Danielle.NewAutoCode_1;
set Danielle.AutocodeAll;
if Sputum_Smear_Result= 'Positive' or Sputum_Smear_Result= 'Negative';
if Therapy_Stop_Reason = 'Completed Therapy';
run;
proc contents data = Danielle.NewAutoCode_1; run;
*Part 1. Cases and Contacts;
proc tabulate data =Danielle.NewAutoCode_1 missing;
TITLE9 "Types of Cases for Investigation" ;
table DispositionClass_Desc="Cases For Investigation" Therapy_Stop_Reason,
Sputum_Smear_Result="Sputum Smear";
Class Sputum_Smear_Result DispositionClass_Desc Therapy_Stop_Reason;
run;
*Reasons Treatment Not Completed;
title '';
data Danielle.NewAutoCode_2;
set Danielle.AutoCodeAll;
if Sputum_Smear_Result='Positive' or Sputum_Smear_Result='Negative';
run;
proc tabulate data = Danielle.NewAutoCode_2;
table Therapy_Stop_Reason='Reason Treatment Not Completed:', Sputum_Smear_Result='Sputum Smear';
Class Sputum_Smear_Result Therapy_Stop_Reason;
run;
Footnote ' Public reporting burden for this collection of information is estimated to average 3 hours per manual by data clerks; 30 minutes per hour
manual response by program managers; 30 minutes per electronic response by data clers and program managers, including the time for reviewing instructions,
searching existing data sources, gathering and maintaining the data needed, and completing and reviewing the collection of information. An agency may
not conduct or sponsor, and a person is not required to respond to a collection of information unless it displays a currently valid OMB control
number. Send comments regarding this burden estimate or any other aspect of this collection of information, including suggestions for reducing this
burden to CDC/ASTDR Information Collection Review Office, 1600 Clfton Road, MS-D-24 Atlanta, GA 30333, ATTN: PRA(0920-0457). Do not send the completed form to this address.';
run;
... View more