[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-1-en-105":3,"doc-seo-246209-105":53,"doc-detail-246209-en":126},{"code":4,"msg":5,"data":6},0,"success",[7,14,19,24,29,34,39,44,49],{"id":8,"doc_module":9,"doc_module_name":10,"category_name":11,"show_sort_weight":12,"slug":13},11,1,"Template","Presentations",90,"presentations",{"id":15,"doc_module":9,"doc_module_name":10,"category_name":16,"show_sort_weight":17,"slug":18},12,"Resumes",80,"resumes",{"id":20,"doc_module":9,"doc_module_name":10,"category_name":21,"show_sort_weight":22,"slug":23},14,"Invoices",70,"invoices",{"id":25,"doc_module":9,"doc_module_name":10,"category_name":26,"show_sort_weight":27,"slug":28},15,"Posters",60,"posters",{"id":30,"doc_module":9,"doc_module_name":10,"category_name":31,"show_sort_weight":32,"slug":33},16,"Social Media",50,"social-media",{"id":35,"doc_module":9,"doc_module_name":10,"category_name":36,"show_sort_weight":37,"slug":38},17,"Forms",40,"forms",{"id":40,"doc_module":9,"doc_module_name":10,"category_name":41,"show_sort_weight":42,"slug":43},18,"Letters",30,"letters",{"id":45,"doc_module":9,"doc_module_name":10,"category_name":46,"show_sort_weight":47,"slug":48},21,"Paper Templates",5,"papers-templates",{"id":50,"doc_module":9,"doc_module_name":10,"category_name":51,"show_sort_weight":4,"slug":52},158,"General","general-158",{"code":4,"msg":54,"data":55},"ok",{"site_id":56,"language":57,"slug":58,"title":59,"keywords":60,"description":61,"schema_data":62,"social_meta":119,"head_meta":121,"extra_data":123,"updated_unix":125},105,"en","sas-to-excel-an-integrated-reporting-system-paper","SAS To EXCEL: An Integrated Reporting System - Paper","","Often, reporting requirements evolve: new reports are added or existing ones must be modified. Instead of rewriting SAS programs for every request, this approach generates formatted, camera-ready Microsoft Excel reports directly from SAS data. A driver program computes all combinations of specified analysis variables, while dedicated report programs read preformatted Excel templates and write results via SAS DDE commands to open, close, and save output workbooks. Minor front-end changes enable efficient expansion.",{"@graph":63,"@context":118},[64,80,101],{"@type":65,"itemListElement":66},"BreadcrumbList",[67,71,74,77],{"item":68,"name":69,"@type":70,"position":9},"https://docshare.wps.com","Home","ListItem",{"item":72,"name":10,"@type":70,"position":73},"https://docshare.wps.com/template/",2,{"item":75,"name":11,"@type":70,"position":76},"https://docshare.wps.com/template/presentations/",3,{"item":78,"name":59,"@type":70,"position":79},"https://docshare.wps.com/template/sas-to-excel-an-integrated-reporting-system-paper/246209/",4,{"url":78,"name":59,"@type":81,"image":82,"author":87,"headline":59,"publisher":90,"fileFormat":93,"inLanguage":57,"description":61,"dateModified":94,"datePublished":95,"encodingFormat":93,"isAccessibleForFree":96,"interactionStatistic":97},"DigitalDocument",{"url":83,"@type":84,"width":85,"height":86},"https://docshare.wps.com/thumbnails/sas-to-excel-an-integrated-reporting-system-paper/246209.png","ImageObject",442,249,{"name":88,"@type":89},"Bill Black","Person",{"url":68,"name":91,"@type":92},"DocShare","Organization","application/pdf","2026-10-26","2026-09-12",true,{"@type":98,"interactionType":99,"userInteractionCount":35},"InteractionCounter",{"@type":100},"ViewAction",{"@type":102,"mainEntity":103},"FAQPage",[104,110,114],{"name":105,"@type":106,"acceptedAnswer":107},"How does the system reduce repeated SAS programming when new reports are requested?","Question",{"text":108,"@type":109},"A driver program builds a summary dataset containing all needed combinations of class and reporting variables. Adding a new report typically requires updating the levels file or the incrementing macro rather than rewriting full programs.","Answer",{"name":111,"@type":106,"acceptedAnswer":112},"What role do the Excel templates play in the reporting workflow?",{"text":113,"@type":109},"Excel spreadsheet templates are manually formatted for each report and specify which variables must be written. SAS report programs read these templates to transfer the summarized values into the correct cells.",{"name":115,"@type":106,"acceptedAnswer":116},"How does SAS communicate with Excel to create the output workbooks?",{"text":117,"@type":109},"The system uses SAS DDE commands to open and close Excel, write to the Excel file, and save the results as output Excel files.","https://schema.org",{"og:url":78,"og:type":120,"og:title":59,"og:site_name":91,"og:description":61},"article",{"robots":122,"canonical":78},"index,follow",{"doc_id":124,"site_id":56},246209,1791731587,{"code":4,"msg":5,"data":127},{"doc_id":124,"user_id":128,"nickname":88,"user_avatar":129,"doc_module":9,"category_id":8,"category_name":11,"doc_title":59,"doc_description":61,"doc_content":130,"file_id":131,"file_url":132,"file_type":133,"file_size":134,"view_count":35,"is_deleted":4,"is_public":9,"is_downloadable":9,"audit_status":9,"page_count":47,"language":135,"language_code":57,"site_id":56,"html_lang":57,"table_of_contents":136,"faqs":137,"seo_title":138,"seo_description":61,"update_tm":139,"read_time":73},24189269381491,"https://ap-avatar.wpscdn.com/avatar/160000cf11732dd8392?x-image-process=image/resize,m_fixed,w_180,h_180&k=1788146458752108895","SAS To EXCEL: An Integrated Reporting System  \nFran Cohen, Westat, Inc. , Rockville, MD  \nABSTRACT  \nOften we need to produce reports from a set of data. Frequently the set of reports gets expanded upon or the programmer is asked to modify the reports already written. Instead of writing new SAS programs for each request, the programmer can use this approach to efficiently and more easily create camera-ready output. This paper describes an integrated approach to creating formatted Microsoft Excel reports from SAS data. A driver program builds all possible combinations of specified analysis variables for a set of reporting variables. Individual report programs read in preformatted Excel templates specifying the variables to be written on each report and write the Excel reports. Commands to open, close, write to an Excel file, and save as output Excel files are given in SAS via DDE. Since all the processing is done at the front end, only minor changes are needed to modify and add reports.  \nOVERVIEW  \nThe first step in the system is to identify the class variables used to construct the reporting variables. To accomplish this, macro code is written to create summaries of the reporting variables. A program identifies the groupings used to increment the reporting variables by reading a file called ‘levels’, meaning class variable levels. Each call to the macro increments each reporting variable for each value of the class variable, creating the output records, which contain the values of the class variable along with the summarized values of the reporting variables. After the macro has been run for all the class variables specified, the output observations are concatenated into one file, which is used for all the reports.  \nIn the second step, the Excel spreadsheet templates are manually formatted for each report. A template can contain a single or multiple sheets for each report.  \nIn the third step, the individual SAS report programs are written to transfer the data from the summary file to the Excel spreadsheet. This program contains the code to read in the pre-formatted Excel templates specifying the variables to be written on each report and write the Excel reports. Commands to open, close, write to an Excel file and save as output Excel files are given in SAS via DDE.  \nOthers have written about automated transfer of data from SAS to Excel. Mumma (1999) compared DDE, PROC IMPORT and other methods of transfer. Vyverman (2001, 2002) discussed in some detail DDE with regard to issuing specific commands given from SAS to Excel. The emphasis here is in creating one SAS database that will serve the purpose of creating many reports with minor changes to the  \nmain program . When a new report is requested with additional class variables, all that is required is to add a record to the levels file containing class variables and rerun the program . When a new report is requested with additional reporting variables, a line or two of code are added to the incrementing macro and the program is rerun. In each of these cases, a new template and SAS report are written, usually with only minor changes from the previous ones.  \nAN EXAMPLE  \nI created a fictitious data set about tennis players to illustrate the system . Our data set will contain two class variables: agegrp and sex of player. The reporting variables will be type of headgear worn to aid in the sun (sunglasses or hats) and type of gear worn to protect the (aging!) body (ankle supports, elbow brace or knee brace) . Here is what the actual output data from step one looks like after all three programs discussed below have been run. This is a simplification of the original application, which involved computing weighted and unweighted counts and rates.  \nc_level agegrp sex c_sungl c_hats c_ankle c_elbow c_kneeb 0 1 4 1 0 4 1  \n0 2 2 3 0 4 1  \n0 3 3 2 0 2 3  \n0 4 3 2 1 2 2  \n0 5 4 1 0 1 4  \n1 1 1 2 1 0 3 0  \n1 1 2 2 0 0 1 1  \n1 2 1 2 0 0 2 0  \n1 2 2 0 3 0 2 1  \n1 3 1 2 1 0 1 2  \n1 3 2 1 1","cbCaimg5QagWBrE3","https://ap.wps.com/l/cbCaimg5QagWBrE3","pdf",55000,"English","# Abstract\n# Overview\n## Step 1: Build reporting variables\n## Step 2: Format Excel templates\n## Step 3: Transfer data via SAS programs\n# An Example\n## Tennis player dataset\n## Incrementing counts by age group\n## Reporting layout in Excel","[{\"question\":\"How does the system reduce repeated SAS programming when new reports are requested?\",\"answer\":\"A driver program builds a summary dataset containing all needed combinations of class and reporting variables. Adding a new report typically requires updating the levels file or the incrementing macro rather than rewriting full programs.\"},{\"question\":\"What role do the Excel templates play in the reporting workflow?\",\"answer\":\"Excel spreadsheet templates are manually formatted for each report and specify which variables must be written. SAS report programs read these templates to transfer the summarized values into the correct cells.\"},{\"question\":\"How does SAS communicate with Excel to create the output workbooks?\",\"answer\":\"The system uses SAS DDE commands to open and close Excel, write to the Excel file, and save the results as output Excel files.\"}]","SAS To EXCEL: An Integrated Reporting System - Paper | PDF",1789234087]