<?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: Proc Report Scientific Notation in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-Report-Scientific-Notation/m-p/791751#M253663</link>
    <description>&lt;P&gt;THANK YOU!!! THAT WORKED!&lt;/P&gt;</description>
    <pubDate>Mon, 24 Jan 2022 01:38:26 GMT</pubDate>
    <dc:creator>BobbyG0627</dc:creator>
    <dc:date>2022-01-24T01:38:26Z</dc:date>
    <item>
      <title>Proc Report Scientific Notation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Report-Scientific-Notation/m-p/791730#M253650</link>
      <description>&lt;P&gt;I have tried several different ways to prevent excel from showing a field as scientific notation in my outputs.&lt;/P&gt;&lt;P&gt;the latest of the code is below using format:#&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;I have tried format: text, I tried different widths.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="inherit"&gt;In Excel, the output always defaults to "General".&amp;nbsp; &amp;nbsp;If I change it manually to Numeric with no decimals it shows the correct number but &lt;/FONT&gt;programmatically&lt;FONT face="inherit"&gt;&amp;nbsp;&lt;/FONT&gt;I&lt;FONT face="inherit"&gt;&amp;nbsp;can not get this work.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;This is what I get in Excel and below that is the code I last used:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SciNotBad.JPG" style="width: 601px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/67636i23DDA90A52DD2320/image-size/large?v=v2&amp;amp;px=999" role="button" title="SciNotBad.JPG" alt="SciNotBad.JPG" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;PROC REPORT DATA = work.output nowd headline headskip split='*' 
style(header)=[font_face='Arial' font_size=9pt font_weight=bold background=lightgrey foreground=black just=c tagattr='wrap:yes']
                          style(column)=[font_face='Arial' font_size=9pt just=l tagattr='wrap:no']; 
Define TrackingNumber / display "Internal Tracking ID" style={TAGATTR="format:#" width=1.5in};

RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 23 Jan 2022 21:51:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Report-Scientific-Notation/m-p/791730#M253650</guid>
      <dc:creator>BobbyG0627</dc:creator>
      <dc:date>2022-01-23T21:51:19Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report Scientific Notation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Report-Scientific-Notation/m-p/791733#M253651</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/style={TAGATTR='format:text'};&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 23 Jan 2022 22:02:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Report-Scientific-Notation/m-p/791733#M253651</guid>
      <dc:creator>ghosh</dc:creator>
      <dc:date>2022-01-23T22:02:45Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report Scientific Notation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Report-Scientific-Notation/m-p/791737#M253653</link>
      <description>&lt;P&gt;thank you, but I mentioned in my post that I tried that, same result unfortunately.&lt;/P&gt;</description>
      <pubDate>Sun, 23 Jan 2022 22:59:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Report-Scientific-Notation/m-p/791737#M253653</guid>
      <dc:creator>BobbyG0627</dc:creator>
      <dc:date>2022-01-23T22:59:01Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report Scientific Notation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Report-Scientific-Notation/m-p/791738#M253654</link>
      <description>&lt;P&gt;Your life will generally be easier if you store IDs that are long strings of numerals as character variables rather than numeric.&lt;/P&gt;</description>
      <pubDate>Sun, 23 Jan 2022 23:07:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Report-Scientific-Notation/m-p/791738#M253654</guid>
      <dc:creator>WarrenKuhfeld</dc:creator>
      <dc:date>2022-01-23T23:07:44Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report Scientific Notation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Report-Scientific-Notation/m-p/791739#M253655</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/413831"&gt;@BobbyG0627&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;thank you, but I mentioned in my post that I tried that, same result unfortunately.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;From re-reading your original post, you tried something different. Did you really try the suggestion from &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/78622"&gt;@ghosh&lt;/a&gt; ?&lt;/P&gt;</description>
      <pubDate>Sun, 23 Jan 2022 23:43:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Report-Scientific-Notation/m-p/791739#M253655</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-01-23T23:43:04Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report Scientific Notation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Report-Scientific-Notation/m-p/791740#M253656</link>
      <description>&lt;P&gt;yes&lt;/P&gt;</description>
      <pubDate>Sun, 23 Jan 2022 23:44:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Report-Scientific-Notation/m-p/791740#M253656</guid>
      <dc:creator>BobbyG0627</dc:creator>
      <dc:date>2022-01-23T23:44:24Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report Scientific Notation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Report-Scientific-Notation/m-p/791742#M253657</link>
      <description>&lt;P&gt;it is stored as character&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="BobbyG0627_0-1642981515480.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/67639i8BCCA4735BB05562/image-size/medium?v=v2&amp;amp;px=400" role="button" title="BobbyG0627_0-1642981515480.png" alt="BobbyG0627_0-1642981515480.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 23 Jan 2022 23:45:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Report-Scientific-Notation/m-p/791742#M253657</guid>
      <dc:creator>BobbyG0627</dc:creator>
      <dc:date>2022-01-23T23:45:26Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report Scientific Notation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Report-Scientific-Notation/m-p/791747#M253659</link>
      <description>&lt;P&gt;It works fine for me. What do you do differently?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data OUTPUT;
  TRACKINGNUMBER='123456789012345';
run;
ods excel file="&amp;amp;wdir\t.xlsx";
proc report data = OUTPUT nowd headline headskip split='*' 
    style(header)=[font_face='Arial' font_size=9pt font_weight=bold background=lightgrey foreground=black just=c tagattr='wrap:yes']
    style(column)=[font_face='Arial' font_size=9pt just=l tagattr='wrap:no']; 
  define TRACKINGNUMBER / display "Internal Tracking ID" style={tagattr="format:#" width=1.5in};
run;
ods excel close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ChrisNZ_0-1642984610865.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/67642iF64C73A08B7A4E2B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ChrisNZ_0-1642984610865.png" alt="ChrisNZ_0-1642984610865.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jan 2022 00:37:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Report-Scientific-Notation/m-p/791747#M253659</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2022-01-24T00:37:13Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report Scientific Notation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Report-Scientific-Notation/m-p/791749#M253661</link>
      <description>&lt;P&gt;How do you output the data to Excel?&lt;/P&gt;
&lt;P&gt;In my environment, I can output as follows without any problem by ODS EXCEL.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data output;
  TrackingNumber='201913070139400';
run;
ods excel;
/* this is your code */
PROC REPORT DATA = work.output nowd headline headskip split='*' 
style(header)=[font_face='Arial' font_size=9pt font_weight=bold background=lightgrey foreground=black just=c tagattr='wrap:yes']
                          style(column)=[font_face='Arial' font_size=9pt just=l tagattr='wrap:no']; 
Define TrackingNumber / display "Internal Tracking ID" style={TAGATTR="format:#" width=1.5in};

RUN;
ods excel close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;results:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2022-01-24_09h29_38.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/67641iB5538974CC5CDAE4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="2022-01-24_09h29_38.png" alt="2022-01-24_09h29_38.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jan 2022 00:41:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Report-Scientific-Notation/m-p/791749#M253661</guid>
      <dc:creator>japelin</dc:creator>
      <dc:date>2022-01-24T00:41:32Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report Scientific Notation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Report-Scientific-Notation/m-p/791750#M253662</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Unfortunately, even when you define a variable as character in SAS, when Excel gets the value, it uses it's own default settings to show the number in the cell. Most of the time, it makes the column width too narrow for long strings and it decides on a numeric format, even for Character strings, that's why using TAGATTR should work for you. Instead of sending a text format, I find it best with Excel to use code like this:&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data makebig;
  length charvar $15 ;
  set sashelp.class;
  where age = 14;
  x = age * height * weight*1713211972;
  charvar = put(x,$15.);
run;
  
ods excel file='c:\temp\tagattr_xl.xlsx';
proc print data=makebig;
var name age sex height weight;
var charvar x /
  style(data)={tagattr='format:###############'};
format x 15.;
run;
 
proc report data=makebig;
column name age sex height weight charvar x;
define  charvar /
  style(column)={tagattr='format:###############'};
define  x / f=15.
  style(column)={tagattr='format:###############'};
run;
 
ods excel close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;When I open the output in Excel, I get the number without scientific notation in both cells (charvar and x).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jan 2022 00:52:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Report-Scientific-Notation/m-p/791750#M253662</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2022-01-24T00:52:00Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report Scientific Notation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Report-Scientific-Notation/m-p/791751#M253663</link>
      <description>&lt;P&gt;THANK YOU!!! THAT WORKED!&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jan 2022 01:38:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Report-Scientific-Notation/m-p/791751#M253663</guid>
      <dc:creator>BobbyG0627</dc:creator>
      <dc:date>2022-01-24T01:38:26Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report Scientific Notation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Report-Scientific-Notation/m-p/791756#M253666</link>
      <description>&lt;P&gt;HOW did you try to tell EXCEL to treat the cell(s) as character strings?&lt;BR /&gt;Following the advice from this &lt;A href="https://support.sas.com/content/dam/SAS/support/en/sas-global-forum-proceedings/2018/2174-2018.pdf" target="_self"&gt;SAS article&lt;/A&gt;&amp;nbsp;to set the TYPE worked for me.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
  x='201913070139400';
run;

ods excel file='c:\downloads\digits.xlsx';
proc report data=test;
define x / style(column)={tagattr="type:String"};
run;
ods excel close;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2022-01-23 234511.jpg" style="width: 293px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/67644i312FF1B723D3B2E4/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2022-01-23 234511.jpg" alt="Screenshot 2022-01-23 234511.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jan 2022 05:11:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Report-Scientific-Notation/m-p/791756#M253666</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-01-24T05:11:23Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report Scientific Notation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Report-Scientific-Notation/m-p/791848#M253699</link>
      <description>&lt;P&gt;this worked for me with what appears to be the same result as yours in the define&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;Define TrackingNumber / display "MCO Internal Tracking ID" &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/CODE&gt;f=$15. style(column)={tagattr='format:###############'};&lt;/PRE&gt;</description>
      <pubDate>Mon, 24 Jan 2022 13:48:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Report-Scientific-Notation/m-p/791848#M253699</guid>
      <dc:creator>BobbyG0627</dc:creator>
      <dc:date>2022-01-24T13:48:01Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report Scientific Notation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Report-Scientific-Notation/m-p/791854#M253702</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/413831"&gt;@BobbyG0627&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;this worked for me with what appears to be the same result as yours in the define&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=""&gt;Define TrackingNumber / display "MCO Internal Tracking ID" &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/CODE&gt;f=$15. style(column)={tagattr='format:###############'};&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;But that defines the cell(s) in Excel as NUMBERS not STRINGS.&amp;nbsp; Excel uses the same floating point representation of numbers as SAS does and so will have the same problem with storing long strings of digits as numbers precisely.&lt;/P&gt;
&lt;P&gt;The little green triangle is how Excel shows that the cell with a string the could be converted to a number is actually being stored as a string.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2022-01-24 090052.jpg" style="width: 282px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/67669i4D5887D9FA6F7DF3/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2022-01-24 090052.jpg" alt="Screenshot 2022-01-24 090052.jpg" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2022-01-23 234511.jpg" style="width: 293px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/67670i0FAA3453BB81FED2/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2022-01-23 234511.jpg" alt="Screenshot 2022-01-23 234511.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jan 2022 14:04:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Report-Scientific-Notation/m-p/791854#M253702</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-01-24T14:04:25Z</dc:date>
    </item>
  </channel>
</rss>

