<?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: Leading Zero's with CSV in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Leading-Zero-s-with-CSV/m-p/44557#M5885</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new, courier;"&gt;data method1;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new, courier;"&gt;&amp;nbsp;&amp;nbsp; set sashelp.class;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new, courier;"&gt;&amp;nbsp;&amp;nbsp; leadzero = catt('=','"000',age,'"');&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new, courier;"&gt;run;&amp;nbsp; &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new, courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new, courier;"&gt;title; footnote;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new, courier;"&gt;ods listing;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new, courier;"&gt;proc print data=method1;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new, courier;"&gt;var name age leadzero;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new, courier;"&gt;run;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new, courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new, courier;"&gt;** Method 1: Use data that has an = in front of value;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new, courier;"&gt;ods listing close;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new, courier;"&gt;ods csv file='c:\temp\uselead.csv';&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new, courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new, courier;"&gt;proc report data=method1 nowd;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new, courier;"&gt;column name age leadzero;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new, courier;"&gt;run;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new, courier;"&gt;ods csv close;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I used your example with success. In this case age is listed as a numeric.&amp;nbsp; In my situation I have values listed as a character.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data test;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;length&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;&amp;nbsp; REASON_FOR_DEFAULT $&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;3&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;set testing;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;IF&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; DFLT_RSN_CD = &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple;"&gt;'DOB'&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;THEN&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; REASON_FOR_DEFAULT = '00&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;1'&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;IF&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; DFLT_RSN_CD = &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple;"&gt;'TTC'&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;THEN&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; REASON_FOR_DEFAULT = '00&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;2'&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;IF&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; DFLT_RSN_CD = &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple;"&gt;'INC'&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;THEN&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; REASON_FOR_DEFAULT = 'INC&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;'&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;data test2;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;set test;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;REASON_FOR_DEFAULT = catt(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple;"&gt;'='&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple;"&gt;'"000'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;,REASON_FOR_DEFAULT,&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple;"&gt;'"'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;ods&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;listing&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;close&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;ods&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;csvall&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;file&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple;"&gt;'/XX/xx09/xxrs/sascode/reporting/test22.csv'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;report&lt;/STRONG&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;data&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;=for_final &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;nowd&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;COLUMNS&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; (_ALL_); &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;ods&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;csv&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;close&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The output howver looks like this&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="271"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD height="20" width="271"&gt;REASON_FOR_DEFAULT&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;="0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;="0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;="0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;="0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;="0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;="0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;="0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;="0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;="0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;="0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;="0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;="0&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does your solution only work when the target variable is numeric&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 27 Oct 2014 20:56:52 GMT</pubDate>
    <dc:creator>Q1983</dc:creator>
    <dc:date>2014-10-27T20:56:52Z</dc:date>
    <item>
      <title>Leading Zero's with CSV</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Leading-Zero-s-with-CSV/m-p/44546#M5874</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am looking at creating a series of excel files using SAS 9.1.3 on a mainframe (z/OS). Becuase of size issues and the fact that not much formatting is needed in the excel file I think that the CSV destination in ODS might be my best bet (The files produced using CSV are much smaller than other destinations). I've been playing around with it a little and the one deal breaker I see is losing leading zeros in numbers that need to be treated as text. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What options exist to preserve leading zero's when using CSV as my destination? Also what is the difference between ODS CSV and ODS TAGSETS.CSV?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I came across this solution on the website:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/rnd/base/ods/templateFAQ/Excel1.pdf"&gt;http://support.sas.com/rnd/base/ods/templateFAQ/Excel1.pdf&lt;/A&gt;&lt;/P&gt;&lt;P align="left"&gt;/* PROC TEMPLATE code that modifies the default CSV tagset by appending the ‘=’ */&lt;/P&gt;&lt;P align="left"&gt;proc template;&lt;/P&gt;&lt;P align="left"&gt;define tagset Tagsets.test;&lt;/P&gt;&lt;P align="left"&gt;parent=tagsets.csv;&lt;/P&gt;&lt;P align="left"&gt;define event data;&lt;/P&gt;&lt;P align="left"&gt;put "," / if !cmp( COLSTART , "1" );&lt;/P&gt;&lt;P align="left"&gt;put '=' """" / if cmp( TYPE , "string" );&lt;/P&gt;&lt;P align="left"&gt;put VALUE;&lt;/P&gt;&lt;P&gt;put """" / if cmp( TYPE , "string" );&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 8pt; font-family: Times New Roman;"&gt;&lt;EM style="font-size: 8pt; font-family: Times New Roman;"&gt; &lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial,helvetica,sans-serif;"&gt;How would I apply this solution to&amp;nbsp; a variable in proc report? Are there any other options that people have used?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial,helvetica,sans-serif;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial,helvetica,sans-serif;"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Nov 2011 19:24:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Leading-Zero-s-with-CSV/m-p/44546#M5874</guid>
      <dc:creator>supp</dc:creator>
      <dc:date>2011-11-09T19:24:13Z</dc:date>
    </item>
    <item>
      <title>Re: Leading Zero's with CSV</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Leading-Zero-s-with-CSV/m-p/44547#M5875</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; That Tech Support PDF file does show an alternate technique that does NOT need a custom TAGSET template. The method requires that you put an '=' sign in front of your quoted character variable, as shown in the Method 1 code below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; You only need the TAGSET template solution shown in that paper if you are unwilling to put an '=' in front of the variable with the leading zero. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(BTW, TAGSETS.CSV is the tagset template that is the "production" name for the CSV destination. TAGSETS.CSV has had a nickname or alias created, so that you could invoke the destination by coding ODS CSV instead of ODS TAGSETS.CSV.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; I would actually recommend 2 possible alternate approaches, that do not require a custom tagset template or altering your data (as shown in the Method 2 and Method 3 code below).&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 method1;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp; set sashelp.class;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt; &lt;/STRONG&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp; leadzero = catt('=','"000',age,'"');&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;run;&amp;nbsp; &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;title; footnote;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;ods listing;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;proc print data=method1;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;var name age leadzero;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;run;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;** Method 1: Use data that has an = in front of value;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;ods listing close;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;ods csv file='c:\temp\uselead.csv';&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;proc report data=method1 nowd;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;column name age leadzero;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;run;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;ods csv close;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;** Method 2: Use TAGATTR with TAGSETS.EXCELXP and style=minimal;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;ods tagsets.excelxp file='c:\temp\uselead_xp.xml'&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; style=minimal;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;proc report data=sashelp.class nowd;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; column name age height weight;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; define age / display &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; style(column)={tagattr="00000"};&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; define height / display&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; style(column)={tagattr="00000"};&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;run;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;ods tagsets.excelxp close;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;** Method 3: Use ODS MSOFFICE2K with HTMLSTYLE;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;ods msoffice2k file='c:\temp\uselead_mso.xls' style=minimal;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;proc report data=sashelp.class nowd;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; column name age height weight;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; define age / display &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; style(column)={htmlstyle="mso-number-format:00000"};&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; define height / display&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; style(column)={htmlstyle="mso-number-format:00000"};&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;run;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;ods msoffice2k close;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Nov 2011 20:12:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Leading-Zero-s-with-CSV/m-p/44547#M5875</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2011-11-09T20:12:07Z</dc:date>
    </item>
    <item>
      <title>Leading Zero's with CSV</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Leading-Zero-s-with-CSV/m-p/44548#M5876</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Thanks Cynthia,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Adding the '=' in front of the variable seems like a reasonable approach. I still don't understand what the tagset template solution detailed in the tech support paper is doing or how I would use it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I agree that your method 2 will work as I have used it before. My concern with using TAGSETS.EXCELXP is the size of the file it produces. I've been testing different approaches trying to decide which is the best. I created an .xml file using excelxp, the data has 20,000 observations and 17 columns and I had trouble getting my job to run to completion because of space issues. I created using HTML and I got the job to complete and it created a 14,000 kb file. I also created using CSV and it created 1,600 kb file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I have never used MSOFFICE2K, but I'm assuming it creates an XML file similar to excelxp? If so, I'm guessing I will run into the same size and space problems as with excelxp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; This was only a test, in reality many of the files I need to create will be smaller but some will also be larger. I feel if I can solve the leading zero problem in CSV it will be a better aproach because of both the file size and CPU time to create the files. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Nov 2011 21:08:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Leading-Zero-s-with-CSV/m-p/44548#M5876</guid>
      <dc:creator>supp</dc:creator>
      <dc:date>2011-11-09T21:08:07Z</dc:date>
    </item>
    <item>
      <title>Leading Zero's with CSV</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Leading-Zero-s-with-CSV/m-p/44549#M5877</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; I tried putting an '=' in front of my data and using the template solution but it did not work. Basically it put an ' =""" ' in frontof evey variable for every observation. Maybe I am using an old version of the tagset?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Nov 2011 01:14:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Leading-Zero-s-with-CSV/m-p/44549#M5877</guid>
      <dc:creator>supp</dc:creator>
      <dc:date>2011-11-10T01:14:17Z</dc:date>
    </item>
    <item>
      <title>Re: Leading Zero's with CSV</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Leading-Zero-s-with-CSV/m-p/44550#M5878</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; ODS MSOFFICE2K creates an HTML file that conforms to the Office 2000 "flavor" of HTML. Microsoft designed their own set of HTML tags specifically for Office 2000. I would expect the HTML file to be slightly smaller than the XML file produced by TAGSETS.EXCELXP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; The tagset template solution in the Tech Support paper is providing an alternative to writing a program that adds the = to your variable with the leading zeroes. A tagset template is a way to add "markup" information to SAS output results. The "markup" information will depend on what type of "markup" information you are trying to create. For example, if you want to have HTML markup information added to your SAS results, then you would use an HTML based destination; if you want to have XML markup information added to your SAS results, then you would use an XML based destination. A comma-delimited file created with ODS CSV is nothing more than your output results "marked up" with commas and quotes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; For example, this shopping list, written on paper:&lt;/P&gt;&lt;P&gt;Sarah - books $50&lt;/P&gt;&lt;P&gt;Lee - bike stuff $25&lt;/P&gt;&lt;P&gt;Fred - sweater $25&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;would be easier to open in an Excel spreadsheet, if it looked like this and was saved as a CSV file:&lt;/P&gt;&lt;P&gt;Person, Gift,Limit&lt;/P&gt;&lt;P&gt;"Sarah","books",50&lt;/P&gt;&lt;P&gt;"Lee","bike stuff",25&lt;/P&gt;&lt;P&gt;"Fred",'Sweater",25&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; And, the same list would be openable in an HTML file, if it looked like what is shown in the attached screen shot that shows the HTML markup next to the browser view of the HTML file. As you can see from the screenshot, the "data" pieces of information are the same in the paper list, the comma-delimited version and the HTML version. What changes is the markup information that has been added to make the list readable and renderable by software applications like Excel or a browser.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; A tagset template tells ODS what "markup information" should be added to your results file. The Tech Support solution is creating a customized version of the CSV tagset template, which adds the = for you, so you don't need a DATA step program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; The program below creates a custom tagset template called TAGSETS.SILLY -- if I want to invoke this tagset template, as an ODS destination, I have to use one of these 2 methods (since I am not able to set an alias for my tagset template like the folks in R&amp;amp;D can do):&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;ods markup tagset=silly file='c:\temp\silly.txt'; OR&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;ods tagsets.silly file='c:\temp\silly.txt';&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; When I use the SILLY tagset template, my result file looks like this:&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;~Name~Sex~Age~Height~Weight&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;~Philip~M~16~72~150&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where the tilde character (~) is the "markup information" and the rest of the information is either the Header or Data information for my single observation. Silly example, but conveys the fact that a tagset template merely provides ODS with information about what kind of markup information to add to the result file created by a SAS procedure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; I have not tried the template approach outlined in the Tech Support example. But looking at the code, I would imagine that it would put an = and double quotes around EVERY string variable in the dataset. That might not be what you want. Any other solution than the one shown will involve a steeper learning curve about tagset templates.&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;Custom TAGSET.SILLY code:&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;ods path work.temp(update)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sasuser.templat(update)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sashelp.tmplmst(read);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;proc template;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; define tagset tagsets.silly;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; define event header;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put "~" value ;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; define event data;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put "~" value ;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; define event row;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put nl;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; end;&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;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;ods tagsets.silly file='c:\temp\silly1.txt';&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;proc print data=sashelp.class noobs;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; where age = 16;&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;&lt;STRONG style="font-family: courier new,courier;"&gt;ods tagsets.silly close;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;ods markup tagset=silly file='c:\temp\silly2.txt';&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;proc print data=sashelp.class noobs;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; where age = 16;&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;&lt;STRONG style="font-family: courier new,courier;"&gt;ods markup close;&lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/11196i8A0DB14589AD301A/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="pix_html_browser_textpad.jpg" title="pix_html_browser_textpad.jpg" /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Nov 2011 06:10:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Leading-Zero-s-with-CSV/m-p/44550#M5878</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2011-11-10T06:10:39Z</dc:date>
    </item>
    <item>
      <title>Re: Leading Zero's with CSV</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Leading-Zero-s-with-CSV/m-p/44551#M5879</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi, I doubt that it is the tagset template that is an issue. The paper outlined an EITHER/OR approach. Either 1) you use a program to put an = in front of your data fields and then use regular ODS CSV &lt;/P&gt;&lt;P&gt;OR &lt;/P&gt;&lt;P&gt;2) you create a custom TAGSET template and then you do NOT have to put an = in front of your data fields. I would expect that things might get ugly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; In my posting above, the method 1 approach does NOT use a custom tagset template -- it just uses regular old ODS CSV, after putting an = in front of the variable with the leading zeroes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Did you try to run a program similar to the method 1 approach shown above without using a custom tagset template?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Nov 2011 06:17:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Leading-Zero-s-with-CSV/m-p/44551#M5879</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2011-11-10T06:17:03Z</dc:date>
    </item>
    <item>
      <title>Leading Zero's with CSV</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Leading-Zero-s-with-CSV/m-p/44552#M5880</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; if appearance is what is needed, consider prefixing relevant numeric variables with the letter O. A suitable format might be something like:&lt;/P&gt;&lt;P&gt;proc format ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; picture znumbers 0-1e11 = '012345678901'(prefix='O' ) ;&lt;/P&gt;&lt;P&gt;run ;&lt;/P&gt;&lt;P&gt;%put %sysfunc( putn( 98765432, znumbers )); &lt;/P&gt;&lt;P&gt;This creates 12 character width with a letter O followed by the integer value with leading zeros&lt;/P&gt;&lt;P&gt;CSV format can be very dense and created quick quickly&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Nov 2011 11:21:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Leading-Zero-s-with-CSV/m-p/44552#M5880</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2011-11-10T11:21:15Z</dc:date>
    </item>
    <item>
      <title>Re: Leading Zero's with CSV</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Leading-Zero-s-with-CSV/m-p/44553#M5881</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Cynthia,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Thank you for your responses it is appreciated. I tried putting an equal sign in front of my variable, policy #, that starts with two leading zero's. But it does not retain the leading zeros in excel. I tried using the custom tagset option with and without appending an '=' sign to the variable. But niether option worked.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I think I might have a syntax error in my define statement because it puts an '=' sign followed by a string of double quotation marks in front of every observation. When looking at the tech support document it is hard to differentiate between single and double quotes, especially when they are strung together.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I also tried appending and single quote mark in front of my variable and it sort of worked. When I open the excel file I see the single quote mark and the leading zero's. For example:&lt;/P&gt;&lt;P&gt;'0055000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; What I would like to see is:&lt;/P&gt;&lt;P&gt;0055000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;edit: I should note that putting a single quote mark in front of a number I want excel to treat as text is my normal method when working in excel and it usually does not display the single quote mark.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Are there any other approaches I can try with the CSV option or some variation of CSV? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Nov 2011 16:17:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Leading-Zero-s-with-CSV/m-p/44553#M5881</guid>
      <dc:creator>supp</dc:creator>
      <dc:date>2011-11-10T16:17:45Z</dc:date>
    </item>
    <item>
      <title>Re: Leading Zero's with CSV</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Leading-Zero-s-with-CSV/m-p/44554#M5882</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; As I said, if you use the tagset template approach, then EVERY character variable will have an = and double quotes around it -- not just your leading zero variable. This is probably NOT what you want. And if you tried a combo of method 1 (putting in your own &lt;span class="lia-unicode-emoji" title=":grinning_face_with_big_eyes:"&gt;😃&lt;/span&gt; and method 2 (using a custom tagset template) -- I don't even want to guess what the results might look like -- probably also not what you want. When I run the Tech Support code, shown at the bottom of the post and modified to have more data, this is what I get for a modified version of SASHELP.CLASS (only show partial rows):&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;"Obs","leadzero","x","Name","Sex","Age","Height","Weight"&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;"1",="00014",="00001",="Alfred",="M",14,69.0,112.5&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;"2",="00013",="00001",="Alice",="F",13,56.5, 84.0&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;"3",="00013",="00001",="Barbara",="F",13,65.3, 98.0&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The attached screenshots show the view in Excel 2010 and the view of the file in Notepad. In the code, when you see&lt;STRONG style=": ; font-size: 18pt; font-family: courier new,courier;"&gt;&lt;SPAN style="color: #008000;"&gt; "&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #00ccff;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #ff00ff;"&gt;"&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN style="color: #ff00ff; font-size: 18pt; font-family: courier new,courier;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 18pt;"&gt;, &lt;/SPAN&gt;it is 4 double quotes, which resolve as shown above and in the screenshots. Peter's solution of using the letter O is very clever and you would only need 1 letter O to have your whole field treated as a character string by Excel. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did you ever try my previously posted Method 1 code, unchanged, using SASHELP.CLASS? What happened in Excel with that result file? If you have been playing around with custom tagset templates, you may want to exit out of SAS and get back into a "clean" session before you submit the Method 1 code -- using my example and data. I still believe that is the simplest and most direct approach. At this point, you might want to open a track with Tech Support for more help.&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;** the tagset template code I tested -- this is Method 2 code;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;ods path work.tmp(update)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sasuser.templat(update)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sashelp.tmplmst(read);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;proc template;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; define tagset tagsets.test;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; parent=tagsets.csv;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; define event data;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put "," / if !cmp(COLSTART, "1");&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put '=' """"/if cmp(TYPE,"string");&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put VALUE;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put """" / if cmp(TYPE,"string");&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; end;&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;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;data one;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; length leadzero x $5;&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; x='00001';&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; leadzero = catt('000',age);&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;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;ods markup file='c:\temp\leadzero_spec.csv' tagset=tagsets.test;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;proc print data=one;&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;&lt;STRONG style="font-family: courier new,courier;"&gt;ods markup close;&lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/11191iE902ED746ED0AAF8/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="view_in_Excel2010.jpg" title="view_in_Excel2010.jpg" /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/11192iFD5F35E2E0F75DC6/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="view_in_Notepad.jpg" title="view_in_Notepad.jpg" /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Nov 2011 17:02:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Leading-Zero-s-with-CSV/m-p/44554#M5882</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2011-11-10T17:02:10Z</dc:date>
    </item>
    <item>
      <title>Re: Leading Zero's with CSV</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Leading-Zero-s-with-CSV/m-p/44555#M5883</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Cyntia, your explanations and screen shots are helpful. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I found something interesting. When I ran your program, I got identical results. I had to add a rs=none to the ODS statetment, but that was the only change.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I ran your program but switched the proc print to proc report I got very different results. Every observation had an '=' sign and double quotation mark in front of it (insted of double quotes around it). Like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="1254" alt="Proc Report.bmp" class="jive-image-thumbnail jive-image" height="374" src="https://communities.sas.com/legacyfs/online/1254_Proc Report.bmp" width="468" /&gt;&lt;/P&gt;&lt;P&gt;Not sure what is causing this, but I think this is the source of a lot of my confusion. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Nov 2011 20:42:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Leading-Zero-s-with-CSV/m-p/44555#M5883</guid>
      <dc:creator>supp</dc:creator>
      <dc:date>2011-11-10T20:42:12Z</dc:date>
    </item>
    <item>
      <title>Leading Zero's with CSV</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Leading-Zero-s-with-CSV/m-p/44556#M5884</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; When I use my code in SAS 9.2 or SAS 9.3, with PROC REPORT instead of PROC PRINT, the PROC REPORT output looks the same as the PROC PRINT output. I would suggest that you work with Tech Support on this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Nov 2011 15:44:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Leading-Zero-s-with-CSV/m-p/44556#M5884</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2011-11-11T15:44:58Z</dc:date>
    </item>
    <item>
      <title>Re: Leading Zero's with CSV</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Leading-Zero-s-with-CSV/m-p/44557#M5885</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new, courier;"&gt;data method1;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new, courier;"&gt;&amp;nbsp;&amp;nbsp; set sashelp.class;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new, courier;"&gt;&amp;nbsp;&amp;nbsp; leadzero = catt('=','"000',age,'"');&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new, courier;"&gt;run;&amp;nbsp; &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new, courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new, courier;"&gt;title; footnote;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new, courier;"&gt;ods listing;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new, courier;"&gt;proc print data=method1;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new, courier;"&gt;var name age leadzero;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new, courier;"&gt;run;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new, courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new, courier;"&gt;** Method 1: Use data that has an = in front of value;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new, courier;"&gt;ods listing close;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new, courier;"&gt;ods csv file='c:\temp\uselead.csv';&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new, courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new, courier;"&gt;proc report data=method1 nowd;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new, courier;"&gt;column name age leadzero;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new, courier;"&gt;run;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new, courier;"&gt;ods csv close;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I used your example with success. In this case age is listed as a numeric.&amp;nbsp; In my situation I have values listed as a character.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data test;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;length&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;&amp;nbsp; REASON_FOR_DEFAULT $&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;3&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;set testing;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;IF&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; DFLT_RSN_CD = &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple;"&gt;'DOB'&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;THEN&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; REASON_FOR_DEFAULT = '00&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;1'&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;IF&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; DFLT_RSN_CD = &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple;"&gt;'TTC'&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;THEN&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; REASON_FOR_DEFAULT = '00&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;2'&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;IF&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; DFLT_RSN_CD = &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple;"&gt;'INC'&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;THEN&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; REASON_FOR_DEFAULT = 'INC&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;'&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;data test2;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;set test;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;REASON_FOR_DEFAULT = catt(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple;"&gt;'='&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple;"&gt;'"000'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;,REASON_FOR_DEFAULT,&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple;"&gt;'"'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;ods&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;listing&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;close&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;ods&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;csvall&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;file&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple;"&gt;'/XX/xx09/xxrs/sascode/reporting/test22.csv'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;report&lt;/STRONG&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;data&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;=for_final &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;nowd&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;COLUMNS&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; (_ALL_); &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;ods&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;csv&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;close&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The output howver looks like this&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="271"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD height="20" width="271"&gt;REASON_FOR_DEFAULT&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;="0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;="0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;="0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;="0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;="0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;="0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;="0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;="0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;="0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;="0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;="0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;="0&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does your solution only work when the target variable is numeric&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Oct 2014 20:56:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Leading-Zero-s-with-CSV/m-p/44557#M5885</guid>
      <dc:creator>Q1983</dc:creator>
      <dc:date>2014-10-27T20:56:52Z</dc:date>
    </item>
    <item>
      <title>Re: Leading Zero's with CSV</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Leading-Zero-s-with-CSV/m-p/44558#M5886</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Should create a new post referencing this. But you are getting the output displayed because you have declared the variable reason_for_default to be 3 characters in length:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New';"&gt;length&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New';"&gt;&amp;nbsp; REASON_FOR_DEFAULT $&lt;/SPAN&gt;&lt;STRONG style="background: white; color: teal; font-family: 'Courier New';"&gt;3&lt;/STRONG&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New';"&gt;Therefore anything past the third character is truncated from the result.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Oct 2014 21:25:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Leading-Zero-s-with-CSV/m-p/44558#M5886</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-10-27T21:25:17Z</dc:date>
    </item>
  </channel>
</rss>

