Computing Environments: NT 4.0 SAS Products: PC SAS 6.12 Other software products: Microsoft Word 97

Size: px
Start display at page:

Download "Computing Environments: NT 4.0 SAS Products: PC SAS 6.12 Other software products: Microsoft Word 97"

Transcription

1 Automating the Quantification of Healthcare Resource Utilization With Base SAS Software Nancy Bourgeois, Manpower Technical, Research Triangle Park, NC Bobbie Coleman, Glaxo Wellcome, Inc., Research Triangle Park, NC ABSTRACT Healthcare researchers often use prevalence, incidence, and rates of patient visits to physicians, hospitalizations and nursing home stays in the general population to better understand the healthcare resource utilization of diseases. These data contribute to the decision-making process regarding which diseases to treat or prevent to improve public health and to minimize healthcare costs. By making this information on healthcare resource utilization from three commonly used US healthcare surveys readily available, these data can be used by epidemiologists within the company without waiting for a programmer to write a program to provide this information. Coming Environments: NT 4.0 SAS Products: PC SAS 6.12 Other software products: Microsoft Word 97 INTRODUCTION In order to make information from three commonly used US Healthcare surveys available to epidemiologists and other interested groups in the company, we created a set of SAS programs and macros to generate reports in several formats that would be useful to these groups. The National Center for Health Statistics (NCHS) datasets that we are concerned with and the types of information they represent are: 1. NAMCS National Ambulatory Medical Care Survey Physician Visit Resource Utilization. 2. NHDS National Hospital Discharge Survey Hospital Resource Utilization. 3. NNHS National Nursing Home Survey Nursing Home Resource Utilization. These programs can be extended to also report on Mortality data using the Compressed Mortality File available from the CDC Web site. These programs can also be used as a model to quantify medication use and frequency of medical procedures with additional data available from the NAMCS and NHDS. We will not address those areas in this report. These programs can be modified easily so that new reports can be generated each year as the latest NCHS datasets become available. The resource utilization information for this project is reported for each ICD9-CM diagnostic code (International Classification of Disease, 9 th Revision, Clinical Modification) or for a specified grouping of these codes which represents a disease entity. In addition, each ICD9 code or code grouping is categorized under a specific Therapeutic Development Group (TDG) for use by specific areas within the company. These groupings and categorizations can be easily changed as the organization s structure changes or as the focus on specific diseases or disease groupings change. The examples shown in this paper will focus on the NAMCS/Physician Visit data. The NHDS/Hospitalization and the NNHS/Nursing Home programs will be very similar, with changes required to look at different in datasets and different numbers of diagnoses available. STEP 1: EXTRACT REQUIRED DATA FROM THE NCHS DATASETS The NCHS datasets are very large and we require only a few diagnostic and weighting fields from each of the datasets for this project. The SAS programs to extract these fields must be edited whenever a new version of the NCHS datasets are available to make any necessary changes such as dataset name, where the locations for the specific fields are, and the record length of the dataset. Once editing is complete, the SAS programs are ready for processing. A sample of the code for the NAMCS/Physician Visit dataset follows. Similar code would be executed to extract the data needed from the NHDS and NNHS datasets to obtain the Hospitalization data and the Nursing Home data. In each of the NCHS datasets, the ICD9 diagnoses codes are available in 3, 4 and 5 digits, representing the different levels of specificity for each diagnosis. For our organization, we required different specificity for different disease entities. You can see in the code that we are extracting the 3, 4 and 5 digit diagnoses codes for all of the records at this point. In Step 4, there is a table that designates which level of diagnostic code is desired for each disease entity. This can be easily modified to fit the organization s needs. The result of this step is a SAS dataset containing only the diagnostic codes and weights from the NCHS dataset. /* NAMCS SAS In Statements */ /* */ NAMCS.SAS Language: SAS for Windows v6.12 In: Namcs.dat Out: Namcs.SD2 Create data file from NAMCS. Extract the diagnosis (3, 4 and 5 digit codes) and medication fields /* Associate the fileref with the external data file for the NAMCS data */ /* Change the location of the dataset */ /* to pick data for desired year */ /* The LRECL may also change */ FILENAME in l:\namcs1997\namcs97.dat LRECL=610 /* DBData libname is set in Setup.SAS */ DATA DBData.namcs INFILE in RECFM=F LRECL=610 diagnos1 $4.

2 diagnos2 diagnos3 diag3dg1 diag3dg2 diag3dg3 diag5dg1 diag5dg2 diag5dg3 weightpt 6. LABEL diagnos1= Four-digit diagnosis #1 diagnos2= Four-digit diagnosis #2 diagnos3= Four-digit diagnosis #3 diag3dg1= Three-digit diagnosis #1 diag3dg2= Three-digit diagnosis #2 diag3dg3= Three-digit diagnosis #3 diag5dg1= Five-digit diagnosis #1 diag5dg2= Five-digit diagnosis #2 diag5dg3= Five-digit diagnosis #3 weightpt= Patient Visit Weight STEP 2: SET UP THE ICD9 CODES AND DESCRIPTIONS This step is needed to obtain the long descriptions for each ICD9 code, so that they can be printed in the final Resource Utilization reports. We obtained the ICD9 ascii codes and descriptions file from Medicode, a division of Ingenix Publishing. If the codes and descriptors were obtained from other sources, the following code would have to be modified to point to the correct positions for the fields needed. This code assumes that the file containing this information is called ICD9.txt. After checking to be sure that the fields are in the correct locations, the following program is run to create a SAS dataset that contains all of the ICD9 codes with their long descriptions. /* */ ICD9.SAS Language: SAS for Windows v6.12 In: ICD9.txt Out: ICD9.SD2 Create the data file for the ICD9 codes and long descriptions */ /* Associate the fileref with the external data file for the ICD9 data */ FILENAME inicd9 W:\DB\icd9.txt /* DBData libname is set in Setup.SAS */ DATA DBData.icd9 INFILE inicd9 RECFM=V INPUT icd9full $ nothing $ icd9desc & $200. LABEL icd9full= ICD9 Code with decimals nothing= nothing icd9desc= Description of ICD9 code RUN /*Create a field to contain the ICD9 code without the decimal points to correspond to the diagnostic codes in the NCHS datasets.*/ data DBData.icd9 (drop=nothing) set DBData.icd9 attrib icd9cat length=$20 label= ICD9 Code without decimals icd9cat = compress(icd9full,. ) out STEP 3: SET UP THE FORMATS FILE The format file is used to define the formats for the TDGs. Edit the following program and change the TDG categories as needed. Run the program to set the formats for printing. In Step 4, the specific ICD9 codes and groups of codes are assigned to their respective TDGs for categorization. /* */ DBFrmts.SAS Language: SAS for Windows v6.12 Defines the formats for the TDG Group that each ICD9 code falls into */ /* LIBRARY libref set in SETUP.SAS */ /* Delete the existing formats in the library */ proc datasets library=library memtype=catalog nolist delete formats /* Define formats for all of the out variables and store them as permanent formats in the library */ proc format library=library /* Format for TDG Group */ value $TDGfmt = R = Respiratory H = HIV/OI I = ID/Hepatitis P = Neurology and Psychiatry G = GI/Metabolic/Musculoskeletal /Dermatology/Urogenital C = Hospital Critical Care O = Ophthalmology/Otology /Congenital Defects/Other /* Format for abbreviated TDG Group */ value TDGAfmt 0 = 1 = R 2 = H 3 = I 4 = P 5 = G 6 = C 7 = O

3 STEP 4: SET UP THE TABLE CONTAINING THE ICD9 CODES AND GROUPS OF CODES NEEDED BY YOUR ORGANIZATION The Word document (ICD9Table.doc) contains the information necessary to: select the desired ICD9 codes needed by your organization, group specific ICD9 codes into categories, set or change the descriptions for individual ICD9 codes or groups of codes, set the TDG for each code or groups of codes, indicate whether the codes should be grouped at the 3- digit, 4-digit, or 5-digit level. An example of this document is shown in Figure 1. Edit the document and make any necessary changes for your organization. You can list one ICD9 code per line in the document or, if several ICD9 codes will be in the same TDG and will be reported with the same number of digits, then the starting and ending ICD9 codes can be entered in the first two columns so that only one entry is required for similar codes. To group codes together into one disease entity in the final report, they will have to have the same Group As and Group Name information specified. They can be entered in the same row, if they are consecutive ICD9 codes, or they can be entered on multiple lines, as long as the Group As and Group Name information is the same. Entering this information in a table in a Microsoft Word document gives a non-programmer the ability to change the ICD9 code groupings, etc. when necessary. This information is converted into a SAS dataset in the next step, which automates the change process allowing faster turnaround time and less programmer involvement. STEP 5: CONVERT THE WORD DOCUMENT TO A SAS DATASET The Word document (ICD9Table.doc) created above, must be converted into a SAS dataset to be used in subsequent steps for this project. The steps to do this conversion are as follows: 1. Open the ICD9Table.doc file in MS Word and select all of the ICD9 codes in the table. Be sure to select all columns. 2. Convert the table to text. Separate the text with Other -! (exclamation point). 3. Choose Save As and save the file in desired directory as ICD9TableExport.txt, so the original document will not be overwritten. 4. Delete any headers or footers. 5. Delete column headings. 6. Delete any blank paragraphs. 7. Select search, then select replace to replace all occurrences of 2 exclamation points (!!) with exclamation point, period, exclamation point (!.!).This will ensure that any empty fields are set to NULL. 8. Save the file. 9. Run the following SAS program to convert the text to a SAS dataset: /* */ CreateICD9Table.SAS Language: SAS for Windows v6.12 Creates the SAS dataset containing the! ICD9 codes desired from a txt file with! as the delimiter */ /* DBData library set in SETUP.SAS */ data DBData.icd9tabl infile w:\db\icd9tableexport.txt dlm=! missover in icd9low $ icd9high $ todelete $ tdg $ numdigit type $ groupas: $25. groupnam: $200. STEP 6: RUN THE RESOURCE UTILIZATION PROGRAMS Each of the resource utilization programs use the ICD9 table created in the previous step to extract the desired diagnoses and corresponding weights from the NCHS datasets as well as group specific codes and categorize codes into their respective TDGs. We have included the Physician Visit program below to demonstrate this process. Similar code would be executed for the Hospitalization and Nursing Home programs. Part I of this program creates a dataset containing all of the 3 digit diagnostic codes from the NAMCS dataset as well as a datasets containing the 4 digit and 5 digit diagnostic codes. Any duplicate diagnoses for a single visit are eliminated. Part II pulls in the include file which contains the code that processes the ICD9Table that contains the ICD9 codes desired and uses that data to extract those specific diagnoses from the NAMCS data. This code can be used without change for all of the other NCHS datasets. Part III consists of several PROC SQL statements that group and summarize the ICD9 codes together and calculate totals and percentages for both the reliable and unreliable estimates. The macro CalcTot can be used unchanged for all of the NCHS datasets. Part IV uses a common macro GetICD9 to insert the ICD9 description for each ICD9 code /* */ Visit.SAS Language: SAS for Windows v6.12 In: Namcs.SD2 Out: Visits.sd2 Extract the records with the diagnosis codes desired from the NAMCS dataset. /* */ /* The DBData library is defined in SETUP.SAS*/ /* Set up a filename for the INCLUDE file that contains processing for the ICD9 Codes*/ FILENAME in1 W:\DB\ICD9Code.sas /*******************************/ /*********** PART I ************/ /*******************************/ /*Extract the 3 digit ICD9 codes*/ /*from all of the diagnoses */

4 DATA Data3dg (keep=diagnos weightpt recnum) SET DBData.namcs ATTRIB diagnos LENGTH=$3 LABEL= ICD-9 three-digit diagnosis code ARRAY dxs {*} $ diag3dg1-diag3dg3 /*Extract all 3 diagnoses */ DO i=1 TO DIM(dxs) IF dxs{i} ^= and SUBSTR(dxs{i},1,1) ^= V and SUBSTR(dxs{i},1,1) ^= E THEN DO recnum = _N_ diagnos = dxs{i} OUTPUT END END /*Eliminate the duplicate diagnoses for the same visit */ proc sort nodupkey BY recnum diagnos /*Extract the 4 digit ICD9 codes from all of the diagnoses */ DATA Data4dg (keep=diagnos4 weightpt recnum) SET DBData.namcs ATTRIB diagnos4 LENGTH=$4 LABEL= ICD-9 four-digit diagnosis code ARRAY dxs4 {*} $ diagnos1-diagnos3 /*Extract all 3 diagnoses */ DO i=1 TO DIM(dxs4) IF dxs4{i} ^= and SUBSTR(dxs4{i},1,1) ^= V and SUBSTR(dxs4{i},1,1) ^= E THEN DO recnum = _N_ diagnos4 = dxs4{i} OUTPUT END END /*Eliminate the duplicate diagnoses for the same visit */ proc sort nodupkey BY recnum diagnos4 /*Extract the 5 digit ICD9 codes from all of the diagnoses */ DATA Data5dg (keep=diagnos5 weightpt recnum) SET DBData.namcs ATTRIB diagnos5 LENGTH=$5 LABEL= ICD-9 five-digit diagnosis code ARRAY dxs5 {*} $ diag5dg1-diag5dg3 /*Extract all 3 diagnoses */ DO i=1 TO DIM(dxs5) IF dxs5{i} ^= and SUBSTR(dxs5{i},1,1) ^= V and SUBSTR(dxs5{i},1,1) ^= E THEN DO recnum = _N_ diagnos5 = dxs5{i} OUTPUT END END /*Eliminate the duplicate diagnoses for the same visit */ proc sort nodupkey BY recnum diagnos5 /*******************************/ /*********** PART II ***********/ /*******************************/ /*Run the procedure to capture only the desired ICD9 Codes using the data from the MS Word table entered in Step 4.*/ */ %INCLUDE in1 /*******************************/ /*********** PART III **********/ /*******************************/ /*Create a dataset that sums the weights by ICD9 category*/ PROC SQL CREATE table DBData.Visits as SELECT icd9cat, typedata, max(tdgcat) AS TDGGroup, max(groupnam) AS icd9desc, (SUM(weightpt))/1000 AS VB, COUNT(icd9cat) AS RelVB FROM DataICD9 GROUP BY icd9cat, typedata ORDER BY VB desc quit /*Calculate the totals and percentages for the entire dataset as well as totals and percentages by TDG */ %CalcTot(DBData.Visits,VB) /*Generate a table containing the total of the unreliable estimates */ PROC SQL CREATE TABLE DBData.VBU as SELECT sum(vb) as VB, sum(relvb) as RelVB, sum(pct) as Pct FROM DBData.Visits WHERE RelVB < 30 quit /*Generate a table containing the total of the unreliable estimates by TDG */ PROC SQL CREATE TABLE DBData.VBTDGU as SELECT max(tdggroup) as TDGGroup, sum(vb) as VB, sum(relvb) as RelVB, sum(tdgpct) as TDGPct FROM DBData.Visits WHERE RelVB < 30 GROUP BY TDGGroup quit

5 /*******************************/ /*********** PART IV ***********/ /*******************************/ /*Concatenate the ICD9 full code and description to each record in the data file */ %GetICD9(DBData.Visits,DBData.ICD9) The following is the include file code (ICD9Code.sas) used by the previous Visit.sas code and by all of the other NCHS programs to extract the desired ICD9 codes and code groups from the NCHS data. /* */ ICD9Code.SAS Language: SAS for Windows v6.12 Creates temporary files for the 3 digit, 4 digit and 5 digit codes desired from the Word table */ /* DBData library is defined in SETUP.SAS */ /*Make a table of all the 3 digit codes desired from the ICD9Table dataset.*/ DATA temp3 SET DBData.icd9tabl if numdigit = 3 /*Separate any groups of ICD9 codes into one record for each code */ data temp3 (keep=diagnos GroupAs GroupNam Type TDG) set temp3 attrib low length = 3 attrib range length = 3 attrib diagnos length = $3 low = icd9low range = icd9high - icd9low do i = 0 to range icd9low = low + i diagnos = left(trim(icd9low)) if length(diagnos) = 1 then diagnos = 00 diagnos if length(diagnos) = 2 then diagnos = 0 diagnos out /*Make a table of all the 4 digit codes desired from the ICD9Table dataset.*/ DATA temp4 SET DBData.icd9tabl if numdigit = 4 /*Separate any groups of ICD9 codes into one record for each code */ data temp4 (keep= diagnos4 GroupAs GroupNam Type TDG) set temp4 attrib low length = 4 attrib high length = 4 attrib range length = 4 attrib diagnos4 length = $4 low = in(left(trim(icd9low)),4.) high = in(left(trim(icd9high)),4.) range = high - low do i = 0 to range icd9low = (low + i,4.) diagnos4 = left(trim(icd9low)) if length(diagnos4) = 1 then diagnos4 = 000 diagnos4 if length(diagnos4) = 2 then diagnos4 = 00 diagnos4 if length(diagnos4) = 3 then diagnos4 = 0 diagnos4 out /*Make a table of all the 5 digit codes desired from the ICD9Table dataset.*/ DATA temp5 SET DBData.icd9tabl if numdigit = 5 /*Separate any groups of ICD9 codes into one record for each code */ data temp5 (keep=diagnos5 GroupAs GroupNam Type TDG) set temp5 attrib low length = 3 attrib range length = 3 attrib diagnos5 length = $5 low = icd9low range = icd9high - icd9low do i = 0 to range icd9low = low + i diagnos5 = left(trim(icd9low)) if length(diagnos5) = 1 then diagnos5 = 0000 diagnos5 if length(diagnos5) = 2 then diagnos5 = 000 diagnos5 if length(diagnos5) = 3 then diagnos5 = 00 diagnos5 if length(diagnos5) = 4 then diagnos5 = 0 diagnos5 out

6 /* Process the 3 digit code datasets */ /*Sort the 3 digit NCHS dataset by icd9cat */ proc sort data=data3dg by diagnos /*Sort the 3 digit ICD9Table dataset by icd9cat */ proc sort data=temp3 by diagnos /*Merge the NCHS diagnoses with the file containing the desired codes to get only the 3 digit codes and code groups desired*/ data Data3dg merge Data3dg(in=in1) temp3(in=in2) by diagnos if in1 and in2 then out /* Process the 4 digit code datasets */ /*Sort the 4 digit NCHS dataset by icd9cat */ proc sort data=data4dg by diagnos4 /*Sort the 4 digit ICD9Table dataset by icd9cat */ proc sort data=temp4 by diagnos4 /*Since some of the 4 digit diagnoses fields in the NCHS dataset only have 3 digits recorded, we have to make sure that those diagnoses are extracted correctly, so 3 digit versions of the 4 digit datasets are created*/ /*Make a dataset of the 4 digit NCHS diagnoses that only have 3 digits */ data Only3 set Data4dg if substr(diagnos4,4,1) = - then do diagnos4 = substr(diagnos4,1,3) out /*Make a dataset of the 4 digit ICD9Table codes desired, but keep only 3 digits*/ data tempset3 set temp4 diagnos4 = substr(diagnos4,1,3) /*Get rid of duplicates*/ proc sort nodupkey BY diagnos4 /*Merge the NCHS diagnoses with the file containing the desired codes to get only the 4 digit codes and code groups desired*/ data Data4dg merge Data4dg(in=in1) temp4(in=in2) by diagnos4 if in1 and in2 then out /*Merge the 3 digit versions of the 4 digit NCHS diagnoses with the file containing the desired codes to get only the 3 digit versions of the codes and code groups desired*/ data Data4dgt merge Only3(in=in1) tempset3(in=in2) by diagnos4 if in1 and in2 then out /* Process the 5 digit code datasets */ /*Sort the 5 digit NCHS dataset by icd9cat */ proc sort data=data5dg by diagnos5 /*Sort the 5 digit ICD9Table dataset by icd9cat */ proc sort data=temp5 by diagnos5 /*Merge the NCHS diagnoses with the file containing the desired codes to get only the 5 digit codes and code groups desired*/ data Data5dg merge Data5dg(in=in1) temp5(in=in2) by diagnos5 if in1 and in2 then out /*Create the final 3 digit code dataset */ DATA DataICD9 (drop=diagnos recnum TDG Type) SET Data3dg attrib icd9cat length=$20 label= ICD-9 Study Category attrib tdgcat length=$3 label= TDG Group attrib typedata length=$3 label=

7 Type - Referent or Study if GroupAs = then icd9cat = diagnos else icd9cat = GroupAs tdgcat = TDG if Type = R then typedata = RRR else if Type = P then typedata = PPP else typedata = SSS /*Create the final 4 digit code dataset */ DATA DataICDb (drop=diagnos4 diagnos recnum TDG Type) SET Data4dg attrib icd9cat length=$20 label= ICD-9 Study Category attrib tdgcat length=$3 label= TDG Group attrib typedata length=$3 label= Type - Reference or Study attrib diagnos length=$3 label= 3 digit diagnosis code /*Set diagnos to the 3 digit code for comparisons */ diagnos = substr(diagnos4,1,3) /*Remove the dash from the end of the 4 digit code*/ if substr(diagnos4,4,1) = - then diagnos4 = substr(diagnos4,1,3) if GroupAs = then icd9cat = diagnos4 else icd9cat = GroupAs tdgcat = TDG if Type = R then typedata = RRR else if Type = P then typedata = PPP else typedata = SSS /*Append the 4 digit codes selected to the 3 digit codes */ proc append base=dataicd9 data=dataicdb /*Create the final 3 digit version of */ /*the 4 digit code dataset */ DATA DataICDd (drop=diagnos4 recnum TDG Type) SET Data4dgt attrib icd9cat length=$20 label= ICD-9 Study Category attrib tdgcat length=$3 label= TDG Group attrib typedata length=$3 label= Type - Referent or Study if GroupAs = then icd9cat = diagnos4 else icd9cat = GroupAs tdgcat = TDG if Type = R then typedata = RRR else if Type = P then typedata = PPP else typedata = SSS /*Append the 4 digit codes selected to the 3 digit codes */ proc append base=dataicd9 data=dataicdd /*Create the final 5 digit code dataset */ DATA DataICDc (drop=diagnos4 diagnos5 recnum TDG Type) SET Data5dg attrib icd9cat length=$20 label= ICD-9 Study Category attrib tdgcat length=$3 label= TDG Group attrib typedata length=$3 label= Type - Reference or Study attrib diagnos4 length=$4 label= 4 digit diagnosis code /*Set diagnos4 to the 4 digit code for comparisons */ diagnos4 = substr(diagnos5,1,4) /*Remove the dash from the end of the 5 digit code*/ if substr(diagnos5,5,1) = - then diagnos5 = substr(diagnos5,1,4) if GroupAs = then icd9cat = diagnos5 else icd9cat = GroupAs tdgcat = TDG if Type = R then typedata = RRR else if Type = P then typedata = PPP else typedata = SSS /* Append the 5 digit codes selected to the 3 and 4 digit codes */ proc append base=dataicd9 data=dataicdc /*Delete temporary datasets*/ PROC DATASETS LIBRARY=WORK DELETE Data3dg Data4dg Data5dg DataICDb DataICDc STEP 7: RUN THE REPORT PROGRAMS The SAS programs that generate the Resource Utilization reports rely on macros that can be used for the Visit, Hospitalization and Nursing Home datasets. Prior to running the report programs, the print macros must be run so that they are available for use by the report printing programs.

8 These macros set up and print the different formatted reports. The sample code for these macros follows: /* PrintMacros.SAS Language: SAS for Windows v6.12 Contains all of the macros used for printing reports in the Resource Utilization Project */ /* Macro Name: FixDesc Macro used in the Print programs to split the ICD9 description into separate lines of 45 characters each */ %MACRO FixDesc(intext,type) /*Break the ICD9 description up into shorter fields for printing*/ array desc{5} $ 45 tempdesc = &intext if &type = PPP then tempdesc = **Pain** tempdesc i = 1 do until (tempdesc = ) if length(tempdesc) > 45 then do desc{i} = substr(tempdesc,1,45) tempdesc = substr(tempdesc,46) /* Make sure words are not split across lines */ if substr(desc{i},45,1) ^= and substr(tempdesc,1,1) ^= then do j = 45 do until (substr(desc{i},j,1) = ) tempdesc = substr(desc{i},j,1) tempdesc desc{i} = substr (desc{i},1,length(desc{i})-1) j = j-1 else do desc{i} = tempdesc tempdesc = i = i + 1 %MEND FixDesc /* PrintAll.SAS In: Utilization dataset, Unreliable totals dataset Out: Word document Create a Word document with the desired Utilization data */ %MACRO PrintAll(RUData,UData,RUtil,Reliable) options nodate nonumber nocenter pagesize=1000 title /*Sort the dataset by descending Utilization */ proc sort data=&rudata by descending &RUtil /*Create the Word document, eliminating the unreliable records */ /*The VBU dataset contains the one line total for unreliable results*/ /*which will be printed as the last line in the report */ data _null_ file &dname /*dname is set by calling program*/ set &RUData(in=inRU) &UData /*If this is the first line, then print Total line*/ if _n_ = 1 then do Tot % / /*Print the records from the reliable data*/ if inru then do if &Reliable >= 30 then do /* Don t print record if unreliable */ /*Split the ICD9 description into lines that are 50 chars long */ typedata icd9full desc{1} TDGGroup &RUtil Pct PERCENT8.2 /*Print the rest of the ICD9 descriptions on separate lines */ if desc{2} ^= desc{2} if desc{3} ^= desc{3} if desc{4} ^= desc{4} if desc{5} ^= desc{5} /*Otherwise, this is the total unreliable line from the dataset.*/

9 /* print it with a description of what it represents */ else All remaining conditions for which reliable estimates could not be &RUtil Pct PERCENT8.2 %MEND PrintAll /* PrintTDG.SAS In: Utilization dataset, Unreliable totals dataset Out: Word document Create a Word document with the desired Utilization data by TDG */ %MACRO PrintTDG(RUData,UData,RUtil,Reliable) options nodate nonumber nocenter pagesize=1000 linesize=256 /*Sort the dataset by TDG Group and descending Utilization */ proc sort data=&rudata by TDGGROUP descending &RUtil /*Sort the unreliable dataset by TDG Group*/ proc sort data=&udata by TDGGROUP /*Create the Word document*/ data _null_ file &dname print notitle /*dname is set by calling program*/ set &RUData by TDGGroup /*Print TDG Total line*/ if first.tdggroup then TDGGroup TDGTot % / if &Reliable >= 30 then do /* Don t print record if unreliable */ /*Split the ICD9 description into lines that are 50 chars long */ %FixDesc(icd9desc,typedata) /*Print the typedata icd9full desc1 &RUtil TDGPct PERCENT8.2 /*Print the rest of the ICD9 descriptions on separate lines */ if desc{2} ^= desc{2} if desc{3} ^= desc{3} if desc{4} ^= desc{4} if desc{5} ^= desc{5} /*This is the total unreliable line from the Unreliable dataset.*/ /* Print it with a description of what it represents */ if last.tdggroup then do set &UData All remaining conditions for which reliable estimates could not be &RUtil TDGPct PERCENT8.2 _page_ %MEND PrintTDG /* PrintUnr.SAS In: Utilization dataset, Unreliable totals dataset Out: Word document Create a Word document with the unreliable Utilization data by TDG */ %MACRO PrintUnr(RUData,RUtil,Reliable) options nodate nonumber nocenter pagesize=1000 linesize=256 /*Sort the dataset by TDG Group and descending Utilization */ proc sort data=&rutil by TDGGROUP icd9cat /*Create the Word document*/ data _null_ file &dname print notitle /*dname is set by calling program*/ set &RUData by TDGGroup /*Print TDG line*/ if first.tdggroup then TDGGroup $TDGfmt. if &Reliable < 30 then do /* Print record if unreliable */

10 /*Split the ICD9 description into lines that are 50 chars long */ %FixDesc(icd9desc,typedata) /*Print the typedata icd9full desc1 $45. /*Print the rest of the ICD9 descriptions on separate lines */ if desc{2} ^= desc{2} if desc{3} ^= desc{3} if desc{4} ^= desc{4} if desc{5} ^= desc{5} if last.tdggroup then do _page_ %MEND PrintUnr /* PrintTot.SAS In: Utilization dataset Out: Word document Create a Word document with the summary totals and percentages */ %MACRO PrintTot(RUData) options nodate nonumber nocenter pagesize=1000 linesize=256 title /*Sort the dataset by TDG */ proc sort data=&rudata by TDGGroup /*Get one record from each TDG (they all have the total for the TDG */ /*as well as the overall total) */ /*Calculate the percentage for each TDG of the overall total */ data temp(keep=tot tdgtot pct TDGGroup) set &RUData by TDGGroup if first.tdggroup then do pct = tdgtot/tot out /*Create the Word document, printing the grand total on the first line,*/ /*and the subtotals and percentages for each TDG next */ data _null_ file &dname /*dname is set by calling program*/ set temp end=last by TDGGroup /*If this is the first line, then print Total line*/ if _n_ = 1 then do Tot % TDGGroup tdgtot pct PERCENT8.2 %MEND PrintTot The following program, PrintVB, prints four different Resource Utilization reports for the Physician Visits. The first report orders the Visit data from the largest utilization to the smallest. The next report does the same thing, but groups the ICD9 codes into their respective TDGs. The third report lists all of the unreliable estimates by ICD9 code. The final report is a summary of the Physician Visit data for each TDG as well as an overall total for the Visit Resource Utilization. Similar programs could be written to report on the Hospitalization, Nursing Home and Mortality data by changing the name of the in and out datasets. This code automatically generates a Word Document, which will be formatted in a later step. /* */ PrintVB.SAS Language: SAS for Windows v6.12 In: Visits.SD2, VBU.sd2, VBTDGU.sd2 Out: VB.doc VBTDG.doc VBTDGUnreliable.doc Create the Word documents with the desired Physician Visit data */ /* The DBData library is defined in SETUP.SAS*/ /*Print the Visit Resource Utilization document by descending utilization*/ %let dname = w:\db\vb.doc %PrintAll(DBData.Visits,DBData.VBU,VB,RelV B) /*Print the Visit utilization by TDG and descending Visit utilization*/ %let dname = w:\db\vbtdg.doc

11 %PrintTDG(DBData.Visits,DBData.VBTDGU,VB,R elvb) /*Print the unreliable Visit estimates by TDG and descending Visit utilization*/ %let dname = w:\db\vbtdgunreliable.doc %PrintUnr(DBData.Visits,VB,RelVB) /*Print the totals and percentages for each TDG*/ %let dname = w:\db\vbsummary.doc %PrintTot(DBData.Visits) STEP 8: FORMAT THE REPORTS The report documents generated by the SAS programs in the previous step contain only the data for the report, without any formatting. For each report, there is a corresponding Word document skeleton that contains the formatting for that particular report, including report and column headings, footers and the correct margin settings. If a different format is desired, edit the skeleton document and make the changes. An example of the Word document skeleton file for the first Physician Visit report can be found in Figure 2. To create the final report for each of the report documents generated by the SAS programs: 1. Open the SAS generated Word document containing the data for the report. 2. Run the BoldFix macro to change the font and font size, bold certain ICD9 codes of interest and remove the column containing the Type of code field. The code for the BoldFix Word macro is shown below. 3. Open the corresponding Word document skeleton for that particular report and copy all of the data from the SAS generated report into the skeleton file. Save the file with a new name so that the skeleton file remains unchanged for later use. The report is now ready for publication. The following is the code for the MS Word macro BoldFix used in step 2 above: Sub BoldFix() BoldFix Macro Change Font and Font Size ActiveDocument.Select With Selection.Font.Name = "Courier New".Size = 8 End With Selection.ParagraphFormat.SpaceAfter = 3 Remove the RRR code and set line to bold For i = 1 To Selection.Find.ClearFormatting With Selection.Find.Text = "RRR".Replacement.Text = "".Forward = True.Wrap = wdfindstop.format = False.MatchCase = True.MatchWholeWord = True.MatchWildcards = False.MatchSoundsLike = False.MatchAllWordForms = False.Execute If.Found = True Then Selection.Delete Selection.Paragraphs(1).Range.Select With Selection.Font.Bold = True End With Selection.MoveDown Unit:=wdParagraph, Count:=1, Extend:=wdMove Else i = End If End With Next i Selection.GoTo What:=wdGoToLine, Which:=wdGoToAbsolute, Count:=1 Remove the SSS code For i = 1 To Selection.Find.ClearFormatting With Selection.Find.Text = "SSS".Replacement.Text = "".Forward = True.Wrap = wdfindstop.format = False.MatchCase = True.MatchWholeWord = True.MatchWildcards = False.MatchSoundsLike = False.MatchAllWordForms = False.Execute If.Found = True Then Selection.Delete Selection.MoveDown Unit:=wdParagraph, Count:=1, Extend:=wdMove Else i = End If End With Next i Selection.GoTo What:=wdGoToLine, Which:=wdGoToAbsolute, Count:=1 Remove the PPP code For i = 1 To Selection.Find.ClearFormatting With Selection.Find.Text = "PPP".Replacement.Text = "".Forward = True.Wrap = wdfindstop.format = False.MatchCase = True.MatchWholeWord = True.MatchWildcards = False.MatchSoundsLike = False.MatchAllWordForms = False.Execute If.Found = True Then Selection.Delete Selection.MoveDown Unit:=wdParagraph, Count:=1, Extend:=wdMove Else i = End If End With Next i

12 End Sub CONCLUSION With this process, we can provide resource utilization data for all diseases or disease categories in one document that can be easily updated with new NCHS data each year. The epidemiologist then has this data readily available and broken down into relevant therapeutic groups without having to engage a programmer to extract this information for every separate request. REFERENCES SAS Institute, Inc. (1990), SAS Language Reference, Version 6, First Edition, Cary, NC. SAS Institute, Inc. (1998), SAS Macro Language Reference, Cary, NC. Microsoft Word 97, Online Help National Hospital Discharge Survey CD-Rom Series 13, 1997 National Ambulatory Medical Care Survey CD-Rom Series 13, and 1995 National Nursing Home Survey Cd- Rom Series 13, U.S. Department of Health and Human Serices Centers for Disease Control and Prevention National Center For Health Statistics International Classification of Disease, 9 th Revision, Clinical Modification - Medicode ACKNOWLEDGMENTS We would like to thank Carlyne Averell, Anne Hickey and Susan Eaton for their support and assistance with this project. SAS is a registered trademark of SAS Institute, Inc. Other brand and product names are registered trademarks or trademarks of their respective companies. CONTACT INFORMATION Your comments and questions are valued and encouraged. Contact the authors at: Nancy Bourgeois Glaxo Wellcome, Inc. 5 Moore Drive Research Triangle Park, NC Fax: neb22289@glaxowellcome.com Bobbie Coleman Glaxo Wellcome, Inc. 5 Moore Drive Research Triangle Park, NC Work Phone: Fax: blc22701@glaxowellcome.com

13 Figure 1. Excerpt from the ICD9Table word document....

14 Figure 2. Skeleton Word document containing preset header and footer information...

Post-Processing.LST files to get what you want

Post-Processing.LST files to get what you want Paper CC04 Post-Processing.LST files to get what you want Edward Foster, Oxford Pharmaceutical Sciences, UK ABSTRACT SAS has a range of procedures you can use to create table and listing output. These

More information

SAS 101. Based on Learning SAS by Example: A Programmer s Guide Chapter 21, 22, & 23. By Tasha Chapman, Oregon Health Authority

SAS 101. Based on Learning SAS by Example: A Programmer s Guide Chapter 21, 22, & 23. By Tasha Chapman, Oregon Health Authority SAS 101 Based on Learning SAS by Example: A Programmer s Guide Chapter 21, 22, & 23 By Tasha Chapman, Oregon Health Authority Topics covered All the leftovers! Infile options Missover LRECL=/Pad/Truncover

More information

Writing Programs in SAS Data I/O in SAS

Writing Programs in SAS Data I/O in SAS Writing Programs in SAS Data I/O in SAS Statistics 135 Autumn 2005 Copyright c 2005 by Mark E. Irwin Writing SAS Programs Your SAS programs can be written in any text editor, though you will often want

More information

ICD_CLASS SAS Software User s Guide. Version FY Prepared for: U.S. Centers for Disease Control and Prevention

ICD_CLASS SAS Software User s Guide. Version FY Prepared for: U.S. Centers for Disease Control and Prevention ICD_CLASS SAS Software User s Guide Version FY 2015 Prepared for: U.S. Centers for Disease Control and Prevention Prepared by: Center for Healthcare Policy and Research University of California, Davis

More information

INTRODUCTION TO SAS HOW SAS WORKS READING RAW DATA INTO SAS

INTRODUCTION TO SAS HOW SAS WORKS READING RAW DATA INTO SAS TO SAS NEED FOR SAS WHO USES SAS WHAT IS SAS? OVERVIEW OF BASE SAS SOFTWARE DATA MANAGEMENT FACILITY STRUCTURE OF SAS DATASET SAS PROGRAM PROGRAMMING LANGUAGE ELEMENTS OF THE SAS LANGUAGE RULES FOR SAS

More information

ICD_CLASS SAS Software User s Guide. Version FY U.S. Centers for Disease Control and Prevention. Prepared for:

ICD_CLASS SAS Software User s Guide. Version FY U.S. Centers for Disease Control and Prevention. Prepared for: ICD_CLASS SAS Software User s Guide Version FY 2016 Prepared for: U.S. Centers for Disease Control and Prevention Prepared by: Center for Healthcare Policy and Research, University of California, Davis

More information

Macro Method to use Google Maps and SAS to Geocode a Location by Name or Address

Macro Method to use Google Maps and SAS to Geocode a Location by Name or Address Paper 2684-2018 Macro Method to use Google Maps and SAS to Geocode a Location by Name or Address Laurie Smith, Cincinnati Children s Hospital Medical Center, Cincinnati, Ohio ABSTRACT Google Maps is a

More information

Prove QC Quality Create SAS Datasets from RTF Files Honghua Chen, OCKHAM, Cary, NC

Prove QC Quality Create SAS Datasets from RTF Files Honghua Chen, OCKHAM, Cary, NC Prove QC Quality Create SAS Datasets from RTF Files Honghua Chen, OCKHAM, Cary, NC ABSTRACT Since collecting drug trial data is expensive and affects human life, the FDA and most pharmaceutical company

More information

3. Almost always use system options options compress =yes nocenter; /* mostly use */ options ps=9999 ls=200;

3. Almost always use system options options compress =yes nocenter; /* mostly use */ options ps=9999 ls=200; Randy s SAS hints, updated Feb 6, 2014 1. Always begin your programs with internal documentation. * ***************** * Program =test1, Randy Ellis, first version: March 8, 2013 ***************; 2. Don

More information

Matt Downs and Heidi Christ-Schmidt Statistics Collaborative, Inc., Washington, D.C.

Matt Downs and Heidi Christ-Schmidt Statistics Collaborative, Inc., Washington, D.C. Paper 82-25 Dynamic data set selection and project management using SAS 6.12 and the Windows NT 4.0 file system Matt Downs and Heidi Christ-Schmidt Statistics Collaborative, Inc., Washington, D.C. ABSTRACT

More information

So Much Data, So Little Time: Splitting Datasets For More Efficient Run Times and Meeting FDA Submission Guidelines

So Much Data, So Little Time: Splitting Datasets For More Efficient Run Times and Meeting FDA Submission Guidelines Paper TT13 So Much Data, So Little Time: Splitting Datasets For More Efficient Run Times and Meeting FDA Submission Guidelines Anthony Harris, PPD, Wilmington, NC Robby Diseker, PPD, Wilmington, NC ABSTRACT

More information

Implementing external file processing with no record delimiter via a metadata-driven approach

Implementing external file processing with no record delimiter via a metadata-driven approach Paper 2643-2018 Implementing external file processing with no record delimiter via a metadata-driven approach Princewill Benga, F&P Consulting, Saint-Maur, France ABSTRACT Most of the time, we process

More information

Create a Format from a SAS Data Set Ruth Marisol Rivera, i3 Statprobe, Mexico City, Mexico

Create a Format from a SAS Data Set Ruth Marisol Rivera, i3 Statprobe, Mexico City, Mexico PharmaSUG 2011 - Paper TT02 Create a Format from a SAS Data Set Ruth Marisol Rivera, i3 Statprobe, Mexico City, Mexico ABSTRACT Many times we have to apply formats and it could be hard to create them specially

More information

Using PROC REPORT to Cross-Tabulate Multiple Response Items Patrick Thornton, SRI International, Menlo Park, CA

Using PROC REPORT to Cross-Tabulate Multiple Response Items Patrick Thornton, SRI International, Menlo Park, CA Using PROC REPORT to Cross-Tabulate Multiple Response Items Patrick Thornton, SRI International, Menlo Park, CA ABSTRACT This paper describes for an intermediate SAS user the use of PROC REPORT to create

More information

A Macro to Manage Table Templates Mark Mihalyo, Community Care Behavioral Health Organization, Pittsburgh, PA

A Macro to Manage Table Templates Mark Mihalyo, Community Care Behavioral Health Organization, Pittsburgh, PA A Macro to Manage Table Templates Mark Mihalyo, Community Care Behavioral Health Organization, Pittsburgh, PA ABSTRACT The scenario: Data must be placed in a table or chart design provided by the company

More information

Base and Advance SAS

Base and Advance SAS Base and Advance SAS BASE SAS INTRODUCTION An Overview of the SAS System SAS Tasks Output produced by the SAS System SAS Tools (SAS Program - Data step and Proc step) A sample SAS program Exploring SAS

More information

A SAS Macro Utility to Modify and Validate RTF Outputs for Regional Analyses Jagan Mohan Achi, PPD, Austin, TX Joshua N. Winters, PPD, Rochester, NY

A SAS Macro Utility to Modify and Validate RTF Outputs for Regional Analyses Jagan Mohan Achi, PPD, Austin, TX Joshua N. Winters, PPD, Rochester, NY PharmaSUG 2014 - Paper BB14 A SAS Macro Utility to Modify and Validate RTF Outputs for Regional Analyses Jagan Mohan Achi, PPD, Austin, TX Joshua N. Winters, PPD, Rochester, NY ABSTRACT Clinical Study

More information

SAS Drug Development Program Portability

SAS Drug Development Program Portability PharmaSUG2011 Paper SAS-AD03 SAS Drug Development Program Portability Ben Bocchicchio, SAS Institute, Cary NC, US Nancy Cole, SAS Institute, Cary NC, US ABSTRACT A Roadmap showing how SAS code developed

More information

A Macro that can Search and Replace String in your SAS Programs

A Macro that can Search and Replace String in your SAS Programs ABSTRACT MWSUG 2016 - Paper BB27 A Macro that can Search and Replace String in your SAS Programs Ting Sa, Cincinnati Children s Hospital Medical Center, Cincinnati, OH In this paper, a SAS macro is introduced

More information

A Way to Work with Invoice Files in SAS

A Way to Work with Invoice Files in SAS A Way to Work with Invoice Files in SAS Anjan Matlapudi and J. Daniel Knapp Pharmacy Informatics, PerformRx, The Next Generation PBM, 200 Stevens Drive, Philadelphia, PA 19113 ABSTRACT This paper illustrates

More information

Exporting & Importing Datasets & Catalogs: Utility Macros

Exporting & Importing Datasets & Catalogs: Utility Macros Exporting & Importing Datasets & Catalogs: Utility Macros Adel Fahmy, SYSMART Consulting, North Brunswick, NJ ABSTRACT Since different companies use different SAS versions installed on different platforms,

More information

Pros and Cons of Interactive SAS Mode vs. Batch Mode Irina Walsh, ClinOps, LLC, San Francisco, CA

Pros and Cons of Interactive SAS Mode vs. Batch Mode Irina Walsh, ClinOps, LLC, San Francisco, CA Pros and Cons of Interactive SAS Mode vs. Batch Mode Irina Walsh, ClinOps, LLC, San Francisco, CA ABSTRACT It is my opinion that SAS programs can be developed in either interactive or batch mode and produce

More information

Run your reports through that last loop to standardize the presentation attributes

Run your reports through that last loop to standardize the presentation attributes PharmaSUG2011 - Paper TT14 Run your reports through that last loop to standardize the presentation attributes Niraj J. Pandya, Element Technologies Inc., NJ ABSTRACT Post Processing of the report could

More information

APPENDIX 4 Migrating from QMF to SAS/ ASSIST Software. Each of these steps can be executed independently.

APPENDIX 4 Migrating from QMF to SAS/ ASSIST Software. Each of these steps can be executed independently. 255 APPENDIX 4 Migrating from QMF to SAS/ ASSIST Software Introduction 255 Generating a QMF Export Procedure 255 Exporting Queries from QMF 257 Importing QMF Queries into Query and Reporting 257 Alternate

More information

Use That SAP to Write Your Code Sandra Minjoe, Genentech, Inc., South San Francisco, CA

Use That SAP to Write Your Code Sandra Minjoe, Genentech, Inc., South San Francisco, CA Paper DM09 Use That SAP to Write Your Code Sandra Minjoe, Genentech, Inc., South San Francisco, CA ABSTRACT In this electronic age we live in, we usually receive the detailed specifications from our biostatistician

More information

SUGI 29 Data Warehousing, Management and Quality

SUGI 29 Data Warehousing, Management and Quality Building a Purchasing Data Warehouse for SRM from Disparate Procurement Systems Zeph Stemle, Qualex Consulting Services, Inc., Union, KY ABSTRACT SAS Supplier Relationship Management (SRM) solution offers

More information

Making an RTF file Out of a Text File, With SAS Paper CC13

Making an RTF file Out of a Text File, With SAS Paper CC13 Making an RTF file Out of a Text File, With SAS Paper CC13 David Franklin Independent SAS Consultant While you are waiting, some trivia. Q is the only letter in the alphabet that does not appear in the

More information

To conceptualize the process, the table below shows the highly correlated covariates in descending order of their R statistic.

To conceptualize the process, the table below shows the highly correlated covariates in descending order of their R statistic. Automating the process of choosing among highly correlated covariates for multivariable logistic regression Michael C. Doherty, i3drugsafety, Waltham, MA ABSTRACT In observational studies, there can be

More information

ODS DOCUMENT, a practical example. Ruurd Bennink, OCS Consulting B.V., s-hertogenbosch, the Netherlands

ODS DOCUMENT, a practical example. Ruurd Bennink, OCS Consulting B.V., s-hertogenbosch, the Netherlands Paper CC01 ODS DOCUMENT, a practical example Ruurd Bennink, OCS Consulting B.V., s-hertogenbosch, the Netherlands ABSTRACT The ODS DOCUMENT destination (in short ODS DOCUMENT) is perhaps the most underutilized

More information

2017 MOC PEDIATRIC PRACTICE LOG TEMPLATE:

2017 MOC PEDIATRIC PRACTICE LOG TEMPLATE: AMERICAN BOARD OF UROLOGY 2017 MAINTENANCE OF CERTIFICATION (MOC) Level 4 PEDIATRIC UROLOGY SUBSPECIALTY CERTIFICATION EXAMINATION PROCESS INSTRUCTIONS FOR SUBMISSION OF ELECTRONIC LOGS Please read all

More information

Chapter 2: Getting Data Into SAS

Chapter 2: Getting Data Into SAS Chapter 2: Getting Data Into SAS Data stored in many different forms/formats. Four categories of ways to read in data. 1. Entering data directly through keyboard 2. Creating SAS data sets from raw data

More information

Essential ODS Techniques for Creating Reports in PDF Patrick Thornton, SRI International, Menlo Park, CA

Essential ODS Techniques for Creating Reports in PDF Patrick Thornton, SRI International, Menlo Park, CA Thornton, S. P. (2006). Essential ODS techniques for creating reports in PDF. Paper presented at the Fourteenth Annual Western Users of the SAS Software Conference, Irvine, CA. Essential ODS Techniques

More information

Routing Output. Producing Output with SAS Software CHAPTER 6

Routing Output. Producing Output with SAS Software CHAPTER 6 125 CHAPTER 6 Routing Output Producing Output with SAS Software 125 The Default Routings for the SAS Log and Procedure Output 126 Changing the Default Routings 127 Using the Print Dialog Box 128 Printing

More information

Uncommon Techniques for Common Variables

Uncommon Techniques for Common Variables Paper 11863-2016 Uncommon Techniques for Common Variables Christopher J. Bost, MDRC, New York, NY ABSTRACT If a variable occurs in more than one data set being merged, the last value (from the variable

More information

Syntax Conventions for SAS Programming Languages

Syntax Conventions for SAS Programming Languages Syntax Conventions for SAS Programming Languages SAS Syntax Components Keywords A keyword is one or more literal name components of a language element. Keywords are uppercase, and in reference documentation,

More information

SAS PROGRAMMING AND APPLICATIONS (STAT 5110/6110): FALL 2015 Module 2

SAS PROGRAMMING AND APPLICATIONS (STAT 5110/6110): FALL 2015 Module 2 SAS PROGRAMMING AND APPLICATIONS (STAT 5110/6110): FALL 2015 Department of MathemaGcs and StaGsGcs Phone: 4-3620 Office: Parker 364- A E- mail: carpedm@auburn.edu Web: hup://www.auburn.edu/~carpedm/stat6110

More information

Procedures. PROC CATALOG CATALOG=<libref.>catalog <ENTRYTYPE=etype> <KILL>; CONTENTS <OUT=SAS-data-set> <FILE=fileref;>

Procedures. PROC CATALOG CATALOG=<libref.>catalog <ENTRYTYPE=etype> <KILL>; CONTENTS <OUT=SAS-data-set> <FILE=fileref;> 355 CHAPTER 19 Procedures SAS Procedures under Windows 355 CATALOG 355 CIMPORT 356 CONTENTS 357 CONVERT 358 CPORT 361 DATASETS 361 OPTIONS 363 PMENU 364 PRINTTO 365 SORT 367 SAS Procedures under Windows

More information

The correct bibliographic citation for this manual is as follows: SAS Institute Inc Proc EXPLODE. Cary, NC: SAS Institute Inc.

The correct bibliographic citation for this manual is as follows: SAS Institute Inc Proc EXPLODE. Cary, NC: SAS Institute Inc. Proc EXPLODE The correct bibliographic citation for this manual is as follows: SAS Institute Inc. 2004. Proc EXPLODE. Cary, NC: SAS Institute Inc. Proc EXPLODE Copyright 2004, SAS Institute Inc., Cary,

More information

Desktop Charge Capture

Desktop Charge Capture Version 4.2 Quick Start Guide for Healthcare Providers Desktop Charge Capture Physician Information System Contents Logging Into Desktop Charge Capture... 1 Introduction to Desktop Charge Capture... 3

More information

Electricity Forecasting Full Circle

Electricity Forecasting Full Circle Electricity Forecasting Full Circle o Database Creation o Libname Functionality with Excel o VBA Interfacing Allows analysts to develop procedural prototypes By: Kyle Carmichael Disclaimer The entire presentation

More information

HAVE YOU EVER WISHED THAT YOU DO NOT NEED TO TYPE OR CHANGE REPORT NUMBERS AND TITLES IN YOUR SAS PROGRAMS?

HAVE YOU EVER WISHED THAT YOU DO NOT NEED TO TYPE OR CHANGE REPORT NUMBERS AND TITLES IN YOUR SAS PROGRAMS? HAVE YOU EVER WISHED THAT YOU DO NOT NEED TO TYPE OR CHANGE REPORT NUMBERS AND TITLES IN YOUR SAS PROGRAMS? Aileen L. Yam, PharmaNet, Inc., Princeton, NJ ABSTRACT In clinical research, the table of contents

More information

Paper CC16. William E Benjamin Jr, Owl Computer Consultancy LLC, Phoenix, AZ

Paper CC16. William E Benjamin Jr, Owl Computer Consultancy LLC, Phoenix, AZ Paper CC16 Smoke and Mirrors!!! Come See How the _INFILE_ Automatic Variable and SHAREBUFFERS Infile Option Can Speed Up Your Flat File Text-Processing Throughput Speed William E Benjamin Jr, Owl Computer

More information

Open Problem for SUAVe User Group Meeting, November 26, 2013 (UVic)

Open Problem for SUAVe User Group Meeting, November 26, 2013 (UVic) Open Problem for SUAVe User Group Meeting, November 26, 2013 (UVic) Background The data in a SAS dataset is organized into variables and observations, which equate to rows and columns. While the order

More information

Omitting Records with Invalid Default Values

Omitting Records with Invalid Default Values Paper 7720-2016 Omitting Records with Invalid Default Values Lily Yu, Statistics Collaborative Inc. ABSTRACT Many databases include default values that are set inappropriately. These default values may

More information

SAS Application Development Using Windows RAD Software for Front End

SAS Application Development Using Windows RAD Software for Front End Applications Development SAS Application Development Using Windows RAD Software for Front End Zhuan (John) Xu Blue Cross Blue Shield ofiowa & Big Creek Software, Des Moines, IA Abstract This paper presents

More information

A Macro to Keep Titles and Footnotes in One Place

A Macro to Keep Titles and Footnotes in One Place CC25 ABSTRACT A Macro to Keep Titles and Footnotes in One Place John Morrill, Quintiles, Inc., Kansas City, MO A large project with titles and footnotes in each separate program can be cumbersome to maintain.

More information

The TIMEPLOT Procedure

The TIMEPLOT Procedure 1247 CHAPTER 38 The TIMEPLOT Procedure Overview 1247 Procedure Syntax 1249 PROC TIMEPLOT Statement 1250 BY Statement 1250 CLASS Statement 1251 ID Statement 1252 PLOT Statement 1252 Results 1257 Data Considerations

More information

ODS/RTF Pagination Revisit

ODS/RTF Pagination Revisit PharmaSUG 2018 - Paper QT-01 ODS/RTF Pagination Revisit Ya Huang, Halozyme Therapeutics, Inc. Bryan Callahan, Halozyme Therapeutics, Inc. ABSTRACT ODS/RTF combined with PROC REPORT has been used to generate

More information

Cleaning Duplicate Observations on a Chessboard of Missing Values Mayrita Vitvitska, ClinOps, LLC, San Francisco, CA

Cleaning Duplicate Observations on a Chessboard of Missing Values Mayrita Vitvitska, ClinOps, LLC, San Francisco, CA Cleaning Duplicate Observations on a Chessboard of Missing Values Mayrita Vitvitska, ClinOps, LLC, San Francisco, CA ABSTRACT Removing duplicate observations from a data set is not as easy as it might

More information

DANCES WITH DATA. Ginger Barlow, Boots Pharmaceuticals, Inc. Angela S. Ringelberg, Boots Pharmaceuticals, Inc. I. EXPLANATION OF PROBLEM

DANCES WITH DATA. Ginger Barlow, Boots Pharmaceuticals, Inc. Angela S. Ringelberg, Boots Pharmaceuticals, Inc. I. EXPLANATION OF PROBLEM DANCES WITH DATA Ginger Barlow, Boots Pharmaceuticals, Inc. Angela S. Ringelberg, Boots Pharmaceuticals, Inc. ABSTRACT: Under the confines of different line sizes and page sizes, how do you produce custom

More information

A Macro that Creates U.S Census Tracts Keyhole Markup Language Files for Google Map Use

A Macro that Creates U.S Census Tracts Keyhole Markup Language Files for Google Map Use Paper 2418-2018 A Macro that Creates U.S Census Tracts Keyhole Markup Language Files for Google Map Use ABSTRACT Ting Sa, Cincinnati Children s Hospital Medical Center This paper introduces a macro that

More information

Producing Summary Tables in SAS Enterprise Guide

Producing Summary Tables in SAS Enterprise Guide Producing Summary Tables in SAS Enterprise Guide Lora D. Delwiche, University of California, Davis, CA Susan J. Slaughter, Avocet Solutions, Davis, CA ABSTRACT This paper shows, step-by-step, how to use

More information

Using SAS Macro to Include Statistics Output in Clinical Trial Summary Table

Using SAS Macro to Include Statistics Output in Clinical Trial Summary Table Using SAS Macro to Include Statistics Output in Clinical Trial Summary Table Amy C. Young, Ischemia Research and Education Foundation, San Francisco, CA Sharon X. Zhou, Ischemia Research and Education

More information

Using SAS software to fulfil an FDA request for database documentation

Using SAS software to fulfil an FDA request for database documentation Using SAS software to fulfil an FDA request for database documentation Introduction Pantaleo Nacci, Adam Crisp Glaxo Wellcome R&D, UK Historically, a regulatory submission to seek approval for a new drug

More information

Excel Level 1

Excel Level 1 Excel 2016 - Level 1 Tell Me Assistant The Tell Me Assistant, which is new to all Office 2016 applications, allows users to search words, or phrases, about what they want to do in Excel. The Tell Me Assistant

More information

Hidden in plain sight: my top ten underpublicized enhancements in SAS Versions 9.2 and 9.3

Hidden in plain sight: my top ten underpublicized enhancements in SAS Versions 9.2 and 9.3 Hidden in plain sight: my top ten underpublicized enhancements in SAS Versions 9.2 and 9.3 Bruce Gilsen, Federal Reserve Board, Washington, DC ABSTRACT SAS Versions 9.2 and 9.3 contain many interesting

More information

ABC Macro and Performance Chart with Benchmarks Annotation

ABC Macro and Performance Chart with Benchmarks Annotation Paper CC09 ABC Macro and Performance Chart with Benchmarks Annotation Jing Li, AQAF, Birmingham, AL ABSTRACT The achievable benchmark of care (ABC TM ) approach identifies the performance of the top 10%

More information

A Cross-national Comparison Using Stacked Data

A Cross-national Comparison Using Stacked Data A Cross-national Comparison Using Stacked Data Goal In this exercise, we combine household- and person-level files across countries to run a regression estimating the usual hours of the working-aged civilian

More information

Taming a Spreadsheet Importation Monster

Taming a Spreadsheet Importation Monster SESUG 2013 Paper BtB-10 Taming a Spreadsheet Importation Monster Nat Wooding, J. Sargeant Reynolds Community College ABSTRACT As many programmers have learned to their chagrin, it can be easy to read Excel

More information

From Manual to Automatic with Overdrive - Using SAS to Automate Report Generation Faron Kincheloe, Baylor University, Waco, TX

From Manual to Automatic with Overdrive - Using SAS to Automate Report Generation Faron Kincheloe, Baylor University, Waco, TX Paper 152-27 From Manual to Automatic with Overdrive - Using SAS to Automate Report Generation Faron Kincheloe, Baylor University, Waco, TX ABSTRACT This paper is a case study of how SAS products were

More information

Automated Macros to Extract Data from the National (Nationwide) Inpatient Sample (NIS)

Automated Macros to Extract Data from the National (Nationwide) Inpatient Sample (NIS) Paper 3327-2015 Automated Macros to Extract Data from the National (Nationwide) Inpatient Sample (NIS) Ravi Gaddameedi, California State University, Eastbay, CA; Usha Kreaden, Intuitive Surgical, Sunnyvale,

More information

A Practical and Efficient Approach in Generating AE (Adverse Events) Tables within a Clinical Study Environment

A Practical and Efficient Approach in Generating AE (Adverse Events) Tables within a Clinical Study Environment A Practical and Efficient Approach in Generating AE (Adverse Events) Tables within a Clinical Study Environment Abstract Jiannan Hu Vertex Pharmaceuticals, Inc. When a clinical trial is at the stage of

More information

AMERICAN BOARD OF UROLOGY 2017 INSTRUCTIONS FOR SUBMISSION OF ELECTRONIC LOGS

AMERICAN BOARD OF UROLOGY 2017 INSTRUCTIONS FOR SUBMISSION OF ELECTRONIC LOGS AMERICAN BOARD OF UROLOGY 2017 INSTRUCTIONS FOR SUBMISSION OF ELECTRONIC LOGS Please read all instructions carefully before preparing your log. It is imperative that you carefully review the data contained

More information

Using GSUBMIT command to customize the interface in SAS Xin Wang, Fountain Medical Technology Co., ltd, Nanjing, China

Using GSUBMIT command to customize the interface in SAS Xin Wang, Fountain Medical Technology Co., ltd, Nanjing, China PharmaSUG China 2015 - Paper PO71 Using GSUBMIT command to customize the interface in SAS Xin Wang, Fountain Medical Technology Co., ltd, Nanjing, China One of the reasons that SAS is widely used as the

More information

An Introduction to Visit Window Challenges and Solutions

An Introduction to Visit Window Challenges and Solutions ABSTRACT Paper 125-2017 An Introduction to Visit Window Challenges and Solutions Mai Ngo, SynteractHCR In clinical trial studies, statistical programmers often face the challenge of subjects visits not

More information

Preserving your SAS Environment in a Non-Persistent World. A Detailed Guide to PROC PRESENV. Steven Gross, Wells Fargo, Irving, TX

Preserving your SAS Environment in a Non-Persistent World. A Detailed Guide to PROC PRESENV. Steven Gross, Wells Fargo, Irving, TX Preserving your SAS Environment in a Non-Persistent World A Detailed Guide to PROC PRESENV Steven Gross, Wells Fargo, Irving, TX ABSTRACT For Enterprise Guide users, one of the challenges often faced is

More information

Text Generational Data Sets (Text GDS)

Text Generational Data Sets (Text GDS) Paper 274-2017 Text Generational Data Sets (Text GDS) Dr. Kannan Deivasigamani HSBC ABSTRACT This paper offers a way to fill the void that SAS currently has with respect to the missing feature in the language,

More information

Privacy Protection Using Base SAS : Purging Sensitive Information from Free Text Emergency Room Data

Privacy Protection Using Base SAS : Purging Sensitive Information from Free Text Emergency Room Data SESUG 2016 Paper EPO-188 Privacy Protection Using Base SAS : Purging Sensitive Information from Free Text Emergency Room Data Michelle White, Thomas Schroeder, Li Hui Chen, Jean Mah U.S. Consumer Product

More information

Using DDE with Microsoft Excel and SAS to Collect Data from Hundreds of Users

Using DDE with Microsoft Excel and SAS to Collect Data from Hundreds of Users Using DDE with Microsoft Excel and SAS to Collect Data from Hundreds of Users Russell Denslow and Yan Li Sodexho Marriott Services, Orlando, FL ABSTRACT A process is demonstrated in this paper to automatically

More information

An Introduction to SAS University Edition

An Introduction to SAS University Edition An Introduction to SAS University Edition Ron Cody From An Introduction to SAS University Edition. Full book available for purchase here. Contents List of Programs... xi About This Book... xvii About the

More information

How to use UNIX commands in SAS code to read SAS logs

How to use UNIX commands in SAS code to read SAS logs SESUG Paper 030-2017 How to use UNIX commands in SAS code to read SAS logs James Willis, OptumInsight ABSTRACT Reading multiple logs at the end of a processing stream is tedious when the process runs on

More information

Automating the Production of Formatted Item Frequencies using Survey Metadata

Automating the Production of Formatted Item Frequencies using Survey Metadata Automating the Production of Formatted Item Frequencies using Survey Metadata Tim Tilert, Centers for Disease Control and Prevention (CDC) / National Center for Health Statistics (NCHS) Jane Zhang, CDC

More information

The Power of PROC SQL Techniques and SAS Dictionary Tables in Handling Data

The Power of PROC SQL Techniques and SAS Dictionary Tables in Handling Data Paper PO31 The Power of PROC SQL Techniques and SAS Dictionary Tables in Handling Data MaryAnne DePesquo Hope, Health Services Advisory Group, Phoenix, Arizona Fen Fen Li, Health Services Advisory Group,

More information

If You Need These OBS and These VARS, Then Drop IF, and Keep WHERE Jay Iyengar, Data Systems Consultants LLC

If You Need These OBS and These VARS, Then Drop IF, and Keep WHERE Jay Iyengar, Data Systems Consultants LLC Paper 2417-2018 If You Need These OBS and These VARS, Then Drop IF, and Keep WHERE Jay Iyengar, Data Systems Consultants LLC ABSTRACT Reading data effectively in the DATA step requires knowing the implications

More information

A Macro To Generate a Study Report Hany Aboutaleb, Biogen Idec, Cambridge, MA

A Macro To Generate a Study Report Hany Aboutaleb, Biogen Idec, Cambridge, MA Paper PO26 A Macro To Generate a Study Report Hany Aboutaleb, Biogen Idec, Cambridge, MA Abstract: Imagine that you are working on a study (project) and you would like to generate a report for the status

More information

10 The First Steps 4 Chapter 2

10 The First Steps 4 Chapter 2 9 CHAPTER 2 Examples The First Steps 10 Invoking the Query Window 11 Changing Your Profile 11 ing a Table 13 ing Columns 14 Alias Names and Labels 14 Column Format 16 Creating a WHERE Expression 17 Available

More information

Procedure for Stamping Source File Information on SAS Output Elizabeth Molloy & Breda O'Connor, ICON Clinical Research

Procedure for Stamping Source File Information on SAS Output Elizabeth Molloy & Breda O'Connor, ICON Clinical Research Procedure for Stamping Source File Information on SAS Output Elizabeth Molloy & Breda O'Connor, ICON Clinical Research ABSTRACT In the course of producing a report for a clinical trial numerous drafts

More information

Posters. Paper

Posters. Paper Paper 212-26 Using SAS/AF to Create a SAS Program File Explorer Rob Nelson, Centers for Disease Control and Prevention, Atlanta, GA Janet Royalty, Centers for Disease Control and Prevention, Atlanta, GA

More information

Microsoft Access Illustrated. Unit B: Building and Using Queries

Microsoft Access Illustrated. Unit B: Building and Using Queries Microsoft Access 2010- Illustrated Unit B: Building and Using Queries Objectives Use the Query Wizard Work with data in a query Use Query Design View Sort and find data (continued) Microsoft Office 2010-Illustrated

More information

Chapter 7 File Access. Chapter Table of Contents

Chapter 7 File Access. Chapter Table of Contents Chapter 7 File Access Chapter Table of Contents OVERVIEW...105 REFERRING TO AN EXTERNAL FILE...105 TypesofExternalFiles...106 READING FROM AN EXTERNAL FILE...107 UsingtheINFILEStatement...107 UsingtheINPUTStatement...108

More information

Chaining Logic in One Data Step Libing Shi, Ginny Rego Blue Cross Blue Shield of Massachusetts, Boston, MA

Chaining Logic in One Data Step Libing Shi, Ginny Rego Blue Cross Blue Shield of Massachusetts, Boston, MA Chaining Logic in One Data Step Libing Shi, Ginny Rego Blue Cross Blue Shield of Massachusetts, Boston, MA ABSTRACT Event dates stored in multiple rows pose many challenges that have typically been resolved

More information

%MAKE_IT_COUNT: An Example Macro for Dynamic Table Programming Britney Gilbert, Juniper Tree Consulting, Porter, Oklahoma

%MAKE_IT_COUNT: An Example Macro for Dynamic Table Programming Britney Gilbert, Juniper Tree Consulting, Porter, Oklahoma Britney Gilbert, Juniper Tree Consulting, Porter, Oklahoma ABSTRACT Today there is more pressure on programmers to deliver summary outputs faster without sacrificing quality. By using just a few programming

More information

Ditch the Data Memo: Using Macro Variables and Outer Union Corresponding in PROC SQL to Create Data Set Summary Tables Andrea Shane MDRC, Oakland, CA

Ditch the Data Memo: Using Macro Variables and Outer Union Corresponding in PROC SQL to Create Data Set Summary Tables Andrea Shane MDRC, Oakland, CA ABSTRACT Ditch the Data Memo: Using Macro Variables and Outer Union Corresponding in PROC SQL to Create Data Set Summary Tables Andrea Shane MDRC, Oakland, CA Data set documentation is essential to good

More information

Introduction to PROC SQL

Introduction to PROC SQL Introduction to PROC SQL Steven First, Systems Seminar Consultants, Madison, WI ABSTRACT PROC SQL is a powerful Base SAS Procedure that combines the functionality of DATA and PROC steps into a single step.

More information

Getting it Done with PROC TABULATE

Getting it Done with PROC TABULATE ABSTRACT Getting it Done with PROC TABULATE Michael J. Williams, ICON Clinical Research, San Francisco, CA The task of displaying statistical summaries of different types of variables in a single table

More information

Teacher Evaluations - A tutorial in some advanced features of SAS. Glenn Millard Stephen F. Austin State University

Teacher Evaluations - A tutorial in some advanced features of SAS. Glenn Millard Stephen F. Austin State University Teacher Evaluations - A tutorial in some advanced features of SAS Glenn Millard Stephen F. Austin State University A number of years ago Stephen F. Austin State University started having the students evaluate

More information

PharmaSUG 2013 CC26 Automating the Labeling of X- Axis Sanjiv Ramalingam, Vertex Pharmaceuticals, Inc., Cambridge, MA

PharmaSUG 2013 CC26 Automating the Labeling of X- Axis Sanjiv Ramalingam, Vertex Pharmaceuticals, Inc., Cambridge, MA PharmaSUG 2013 CC26 Automating the Labeling of X- Axis Sanjiv Ramalingam, Vertex Pharmaceuticals, Inc., Cambridge, MA ABSTRACT Labeling of the X-axis usually involves a tedious axis statement specifying

More information

Customizing Your SAS Session

Customizing Your SAS Session 13 CHAPTER 2 Customizing Your SAS Session Introduction 13 Specifying System Options in the SAS Command 14 Configuration Files 15 Creating a User Configuration File 15 Specifying a User Configuration File

More information

Excel Introduction to Excel Databases & Data Tables

Excel Introduction to Excel Databases & Data Tables Creating an Excel Database Key field: Each record should have some field(s) that helps to uniquely identify them, put these fields at the start of your database. In an Excel database each column is a field

More information

PDF Multi-Level Bookmarks via SAS

PDF Multi-Level Bookmarks via SAS Paper TS04 PDF Multi-Level Bookmarks via SAS Steve Griffiths, GlaxoSmithKline, Stockley Park, UK ABSTRACT Within the GlaxoSmithKline Oncology team we recently experienced an issue within our patient profile

More information

Using UNIX Shell Scripting to Enhance Your SAS Programming Experience

Using UNIX Shell Scripting to Enhance Your SAS Programming Experience Using UNIX Shell Scripting to Enhance Your SAS Programming Experience By James Curley SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute

More information

SAS and Data Management Kim Magee. Department of Biostatistics College of Public Health

SAS and Data Management Kim Magee. Department of Biostatistics College of Public Health SAS and Data Management Kim Magee Department of Biostatistics College of Public Health Review of Previous Material Review INFILE statement data bp; infile c:\sas\bp.csv dlm=, ; input clinic $ dbp1 sbp1

More information

A Practical Introduction to SAS Data Integration Studio

A Practical Introduction to SAS Data Integration Studio ABSTRACT A Practical Introduction to SAS Data Integration Studio Erik Larsen, Independent Consultant, Charleston, SC Frank Ferriola, Financial Risk Group, Cary, NC A useful and often overlooked tool which

More information

SAS CURRICULUM. BASE SAS Introduction

SAS CURRICULUM. BASE SAS Introduction SAS CURRICULUM BASE SAS Introduction Data Warehousing Concepts What is a Data Warehouse? What is a Data Mart? What is the difference between Relational Databases and the Data in Data Warehouse (OLTP versus

More information

PharmaSUG Paper PO12

PharmaSUG Paper PO12 PharmaSUG 2015 - Paper PO12 ABSTRACT Utilizing SAS for Cross-Report Verification in a Clinical Trials Setting Daniel Szydlo, Fred Hutchinson Cancer Research Center, Seattle, WA Iraj Mohebalian, Fred Hutchinson

More information

SAS Viya 3.1 FAQ for Processing UTF-8 Data

SAS Viya 3.1 FAQ for Processing UTF-8 Data SAS Viya 3.1 FAQ for Processing UTF-8 Data Troubleshooting Tips for Processing UTF-8 Data (Existing SAS Code) What Is the Encoding of My Data Set? PROC CONTENTS displays information about the data set

More information

Paper An Automated Reporting Macro to Create Cell Index An Enhanced Revisit. Shi-Tao Yeh, GlaxoSmithKline, King of Prussia, PA

Paper An Automated Reporting Macro to Create Cell Index An Enhanced Revisit. Shi-Tao Yeh, GlaxoSmithKline, King of Prussia, PA ABSTRACT Paper 236-28 An Automated Reporting Macro to Create Cell Index An Enhanced Revisit When generating tables from SAS PROC TABULATE or PROC REPORT to summarize data, sometimes it is necessary to

More information

A SAS/AF Application for Linking Demographic & Laboratory Data For Participants in Clinical & Epidemiologic Research Studies

A SAS/AF Application for Linking Demographic & Laboratory Data For Participants in Clinical & Epidemiologic Research Studies Paper 208 A SAS/AF Application for Linking Demographic & Laboratory Data For Participants in Clinical & Epidemiologic Research Studies Authors: Emily A. Mixon; Karen B. Fowler, University of Alabama at

More information

Want to Do a Better Job? - Select Appropriate Statistical Analysis in Healthcare Research

Want to Do a Better Job? - Select Appropriate Statistical Analysis in Healthcare Research Want to Do a Better Job? - Select Appropriate Statistical Analysis in Healthcare Research Liping Huang, Center for Home Care Policy and Research, Visiting Nurse Service of New York, NY, NY ABSTRACT The

More information

2. Don t forget semicolons and RUN statements The two most common programming errors.

2. Don t forget semicolons and RUN statements The two most common programming errors. Randy s SAS hints March 7, 2013 1. Always begin your programs with internal documentation. * ***************** * Program =test1, Randy Ellis, March 8, 2013 ***************; 2. Don t forget semicolons and

More information