[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-1-en-105":3,"doc-seo-239682-105":53,"doc-detail-239682-en":127},{"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":120,"head_meta":122,"extra_data":124,"updated_unix":126},105,"en","paper-sib-105-customized-excel-output-using-the-excel-libname","Paper SIB-105 - Customized Excel Output Using the Excel Libname","","Paper SIB-105 explains how the SAS EXCEL libname engine enables customized Excel output by writing SAS data into pre-defined named ranges inside an existing, tailored Excel worksheet. It contrasts this approach with Dynamic Data Exchange (DDE), highlighting DDE’s complexity, limited error handling, and the need to run Excel on the client machine. A step-by-step workflow covers layout design, range definition, data reshaping, and populating the report through libname.",{"@graph":63,"@context":119},[64,80,102],{"@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/paper-sib-105-customized-excel-output-using-the-excel-libname/239682/",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/paper-sib-105-customized-excel-output-using-the-excel-libname/239682.png","ImageObject",442,249,{"name":88,"@type":89},"Riley West","Person",{"url":68,"name":91,"@type":92},"DocShare","Organization","application/pdf","2026-11-04","2026-09-11",true,{"@type":98,"interactionType":99,"userInteractionCount":101},"InteractionCounter",{"@type":100},"ViewAction",20,{"@type":103,"mainEntity":104},"FAQPage",[105,111,115],{"name":106,"@type":107,"acceptedAnswer":108},"What problem does the Excel libname engine solve compared with DDE?","Question",{"text":109,"@type":110},"It provides a method to push SAS data into customized Excel worksheets using pre-defined named ranges without the extra syntactic difficulty, weak error handling, and Excel client requirement commonly associated with DDE.","Answer",{"name":112,"@type":107,"acceptedAnswer":113},"How is SAS data mapped into a customized Excel report when using the Excel libname?",{"text":114,"@type":110},"SAS writes data into specific named ranges within the target workbook. The workflow is: create the Excel layout, define the receiving range, reshape the SAS data to match the range structure, then load and populate via the Excel libname.",{"name":116,"@type":107,"acceptedAnswer":117},"What are the key limitations of the Excel libname compared with DDE?",{"text":118,"@type":110},"The paper notes that Excel libname cannot create new workbooks or sheets and named ranges, cannot apply formatting like font and color, and has restrictions such as not being able to delete formulas-containing cells or append data in ways DDE may support.","https://schema.org",{"og:url":78,"og:type":121,"og:title":59,"og:site_name":91,"og:description":61},"article",{"robots":123,"canonical":78},"index,follow",{"doc_id":125,"site_id":56},239682,1791741588,{"code":4,"msg":5,"data":128},{"doc_id":125,"user_id":129,"nickname":88,"user_avatar":130,"doc_module":9,"category_id":8,"category_name":11,"doc_title":59,"doc_description":61,"doc_content":131,"file_id":132,"file_url":133,"file_type":134,"file_size":135,"view_count":101,"is_deleted":4,"is_public":9,"is_downloadable":9,"audit_status":9,"page_count":8,"language":136,"language_code":57,"site_id":56,"html_lang":57,"table_of_contents":137,"faqs":138,"seo_title":139,"seo_description":61,"update_tm":140,"read_time":79},1099523885074,"https://ap-avatar.wpscdn.com/davatar_9964176cb1d06d4a9deccf72a44ae3dc","Paper SIB-105  \nCustomized Excel Output Using the Excel Libname  \nHarry Droogendyk, Stratia Consulting Inc. , Lynden , ON  \nABSTRACT  \nThe advent of the ODS ExcelXP tagset and its many features has afforded the SAS© user great flexibility in creating publishable Excel output. But what if the report must be delivered by populating pre-defined, customized Excel worksheets? DDE has been around for ages, and is a viable option, but often not a simple one to execute. This paper will demonstrate another method, the EXCEL libname engine. Using the EXCEL libname, SAS is able to write data into specific, pre-defined“named ranges” in customized Excel worksheets.  \nINTRODUCTION  \nThere has always been ways to move SAS data to Excel , even if it was as simple as opening a SAS-created delimited text file in Excel. Since Excel quite happily opens HTML files, as enhancements were made to the SAS System , users began to utilize ODS HTML ( or data step PUTs ) to create customized output. When Excel XP/2003 added support for XML, an entirely new range of possibilities opened up with the creation of the ever-improving ExcelXP tagset.  \nAny of the methods already mentioned work well for displaying tabular data. Until the inclusion of the Excel libname in the SAS Access for PC Files software, if the Excel output required special or heavily customized formatting, the only choice was Dynamic Data Exchange, or DDE. While DDE is very powerful , it has a number of significant drawbacks. For anything beyond the simplest operations, DDE can be syntactically difficult, and worse, provides only rudimentary error handling and reporting when things go awry. In addition, Excel must actually be invoked on the machine, tying up the PC while the spreadsheet is manipulated / populated by DDE.  \nThe SAS 9 Excel Libname statement allows the pushing and pulling of SAS data to/from Excel , even if Excel is not installed on the machine running SAS. This paper will only focus on creating Excel output using the libname engine. See the References section at the end of the paper for additional information on pulling data from Excel into SAS.  \nThe procedure for creating customized Excel Output using SAS’s Excel libname engine:  \n1. Create a customized report layout in Excel  \n2. Define a range in Excel to receive the SAS data  \n3. Process the SAS data and massage it into the shape of the range  \n4. Use the Excel libname to load the Excel range and populate the report.  \nEXCEL LIBNAME  \nThe Excel libname syntax is quite familiar:  \nlibname xls \u003Cengine-name> physical-file-name ; eg .  \nlibname xls excel 'c:\\temp\\report .xls' ;  \n… SAS code …  \nlibname xls clear ; * very important !! ;  \nIf the physical file specified does not exist, SAS will create a workbook of that name. Once the libname statement is successfully executed, the Excel workbook and the sheets and named ranges defined in the workbook will be available in the SAS Explorer window.  \nThe library can be treated like any other SAS libref with a couple of caveats:  \n􀂷 row and column limitations as defined by Excel , eg. 64K rows, 256 columns for Excel 2003  \n􀂷 Excel sheet and column names can contain characters not normally considered valid by SAS, use of options validvarname=any may be necessary when reading from Excel using the libname.  \nTo reference Excel sheet names and named ranges, the familiar libref.dataset syntax is used ( sheet names are suffixed with $ , necessitating the use of SAS Name Literals syntax, ie. ‘sheet1$’n when referencing ) .  \neg:  \ndata xls . 'sheet1$'n; * referencing worksheet sheet1 ;  \ndata xls .range_out; * referencing named range range_out;  \nWRITING SAS DATA TO EXCEL  \nTo populate Excel spreadsheets with the libname engine, most any DATA or PROC step can be used, eg.  \ndata xls .class;  \nset sashelp .class;  \nrun;  \nproc copy in = sashelp  \nout = xls;  \nselect prdsale shoes;  \nrun;  \nAfter the DATA and PROC COPY steps are run, the SAS Explorer can be used to display the contents of","cbCaigbPZmhDjykV","https://ap.wps.com/l/cbCaigbPZmhDjykV","pdf",517656,"English","# Introduction\n## ExcelXP and earlier SAS-to-Excel methods\n## Why use the Excel libname engine\n# Procedure for Customized Excel Output\n## Create Excel layout\n## Define receiving range\n## Massage SAS data\n## Populate via Excel libname\n# EXCEL LIBNAME\n## Basic syntax and workbook creation\n## Working with librefs and named ranges\n# Writing SAS Data to Excel\n## Populating worksheets and verifying created entities\n# Excel Libname Limitations","[{\"question\":\"What problem does the Excel libname engine solve compared with DDE?\",\"answer\":\"It provides a method to push SAS data into customized Excel worksheets using pre-defined named ranges without the extra syntactic difficulty, weak error handling, and Excel client requirement commonly associated with DDE.\"},{\"question\":\"How is SAS data mapped into a customized Excel report when using the Excel libname?\",\"answer\":\"SAS writes data into specific named ranges within the target workbook. The workflow is: create the Excel layout, define the receiving range, reshape the SAS data to match the range structure, then load and populate via the Excel libname.\"},{\"question\":\"What are the key limitations of the Excel libname compared with DDE?\",\"answer\":\"The paper notes that Excel libname cannot create new workbooks or sheets and named ranges, cannot apply formatting like font and color, and has restrictions such as not being able to delete formulas-containing cells or append data in ways DDE may support.\"}]","Paper SIB-105 - Customized Excel Output Using the Excel Libname | PDF",1789151835]