<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Best practices for setting formats and informats? +ODS question in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Best-practices-for-setting-formats-and-informats-ODS-question/m-p/123284#M1559</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Couldn't have asked for a better answer than that. Thanks Cynthia, very informative.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 17 Sep 2012 06:19:04 GMT</pubDate>
    <dc:creator>TurnTheBacon</dc:creator>
    <dc:date>2012-09-17T06:19:04Z</dc:date>
    <item>
      <title>Best practices for setting formats and informats? +ODS question</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Best-practices-for-setting-formats-and-informats-ODS-question/m-p/123281#M1556</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1) Can someone please direct me to a source where I can learn "best practices" for setting suitable formats and informats?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) Is it correct that ODS MARKUP is the ideal way to format a .CSV-file? I only want to set basic column width and headers for the Excel report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 16 Sep 2012 20:55:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Best-practices-for-setting-formats-and-informats-ODS-question/m-p/123281#M1556</guid>
      <dc:creator>TurnTheBacon</dc:creator>
      <dc:date>2012-09-16T20:55:29Z</dc:date>
    </item>
    <item>
      <title>Re: Best practices for setting formats and informats? +ODS question</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Best-practices-for-setting-formats-and-informats-ODS-question/m-p/123282#M1557</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you want to use DI Studio for this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 16 Sep 2012 22:00:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Best-practices-for-setting-formats-and-informats-ODS-question/m-p/123282#M1557</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2012-09-16T22:00:39Z</dc:date>
    </item>
    <item>
      <title>Re: Best practices for setting formats and informats? +ODS question</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Best-practices-for-setting-formats-and-informats-ODS-question/m-p/123283#M1558</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;&amp;nbsp; Not sure about #1, what you mean by "suitable" formats and informats. I have always found my formats and informats to be dictated by 2 things:&lt;/P&gt;&lt;P&gt;1) input task (reading a data file into a SAS data set or creating informats for data transformation purposes) (INFORMATS)&lt;/P&gt;&lt;P&gt;2) display task (displaying my data for reporting purposes or creating formats for data transformation purposes) (FORMATS)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; But for #2 -- ODS CSV, ODS CSVALL and ODS TAGSETS.CSVBYLINE are 3 ODS MARKUP destinations that allow you to create CSV files from SAS procedure output (such as a PROC PRINT of a SAS dataset or directly from one of your other SAS procedures). However, ODS is not the -only- way to create CSV files. PROC EXPORT can create a CSV file from a SAS dataset. You could write a DATA step program to create a CSV file from a SAS dataset and/or you could look for some older macro programs and tools, like the older %DS2CSV macro program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; However, you said that you want to set "basic column width and headers for the Excel report" -- CSV -- whether you use PROC EXPORT or ODS -- has NO way to set column widths, no way to set any header attributes beyond using the variable name or variable label.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; If you wanted to explicitly set column widths and/or colors or fonts, you would have to use other ODS destinations, such as ODS MSOFFICE2K and/or ODS TAGSETS.EXCELXP. These two destinations are also ODS MARKUP destinations. In fact, any ODS destination that creates explicit "markup language" output, such as ODS HTML, ODS, MSOFFICE2K, ODS CSV, ODS LaTeX, ODS PHTML, ODS CHTML, ODS TAGSETS.EXCELXP etc, etc are ALL ODS MARKUP destinations. Using ODS MARKUP is a great way to create markup language result files by just changing the tagset template that's used by the destination.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; See the code and screenshot below for an example of setting width for a LONG column value. The NEWNAME variable is rather long and you can see in the CSV file that a default column width is used by Excel when the CSV file is opened. There is different behavior with ODS MSOFFICE2K and ODS TAGSETS.EXCELXP because the CELLWIDTH style override is used by Excel when it opens the XML file (created by TAGSETS.EXCELXP) or the HTML file (created by ODS MSOFFICE2K). And, for an extra wow factor, I change the header colors with a style override too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;data class;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; length newname $80;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; set sashelp.class;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; newname = catx(' ',name,repeat(substr(name,1,2),7));&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; newname = propcase(newname);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;** ODS MSOFFICE2K is really making an HTML file;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;** but we want to open it with Excel so give it an XLS file extension;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;** ODS TAGSETS.EXCELXP is making an XML file, but Excel 2003 and higher;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;** knows how to open this XML file.;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;ods tagsets.excelxp file='c:\temp\xp.xml' style=sasweb;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;ods msoffice2k file='c:\temp\mso.xls' style=sasweb;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;ods csv file='c:\temp\comma.csv';&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;proc print data=class noobs&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; style(header)={background=pink foreground=black};&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; var newname /style(data)={cellwidth=2.5in};&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; var name age height weight;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;ods _all_ close;&lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/11788iB91A4502E248482F/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="make_file_for_excel.png" title="make_file_for_excel.png" /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Sep 2012 01:33:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Best-practices-for-setting-formats-and-informats-ODS-question/m-p/123283#M1558</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2012-09-17T01:33:57Z</dc:date>
    </item>
    <item>
      <title>Re: Best practices for setting formats and informats? +ODS question</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Best-practices-for-setting-formats-and-informats-ODS-question/m-p/123284#M1559</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Couldn't have asked for a better answer than that. Thanks Cynthia, very informative.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Sep 2012 06:19:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Best-practices-for-setting-formats-and-informats-ODS-question/m-p/123284#M1559</guid>
      <dc:creator>TurnTheBacon</dc:creator>
      <dc:date>2012-09-17T06:19:04Z</dc:date>
    </item>
  </channel>
</rss>

