<?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: Create a data set in SAS in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Create-a-data-set-in-SAS/m-p/826380#M326413</link>
    <description>&lt;P&gt;1) If you can figure it out directly in Excel, do that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2) I don't see how creating a SAS data set with datalines / cards relates to importing an Excel sheet as data?&lt;/P&gt;</description>
    <pubDate>Mon, 01 Aug 2022 04:35:30 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2022-08-01T04:35:30Z</dc:date>
    <item>
      <title>Create a data set in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-data-set-in-SAS/m-p/826378#M326412</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;Someone sent me an excel file with 3 columns.&lt;/P&gt;
&lt;P&gt;He told me that he cannot perform calculations on these columns.&lt;/P&gt;
&lt;P&gt;I checked and I saw that the format of the columns in Excel is "General" and I have tried to convert it to "Number" format but it didn't work.&lt;/P&gt;
&lt;P&gt;I thought that it will be a good idea to import the table into SAS and than export it into excel and see get the 3 columns as Number format in excel.&lt;/P&gt;
&lt;P&gt;I am trying to create a data set in SAS but it is not working, I get a data set with null values.&lt;/P&gt;
&lt;P&gt;What is the way to do it correctly please?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data have;
Input X1 X2 X3;
cards;
&amp;nbsp;22,532,091.84 97,797.96 9,338,743.32
&amp;nbsp;15,573,220.09 107,197.59 3,253,073.34
&amp;nbsp;17,601,372.44 170,123.33 2,157,860.99
&amp;nbsp;15,948,182.53 172,386.86 1,047,729.41
&amp;nbsp;10,297,115.52 162,988.85 570,263.86
&amp;nbsp;15,617,336.02 269,261.03 473,274.83
&amp;nbsp;10,795,404.83 330,659.42 274,623.30
&amp;nbsp;9,010,041.04 452,650.78 155,526.25
&amp;nbsp;2,389,875.61 217,180.51 20,502.96
&amp;nbsp;861,068,080.33 5,196,905.31 44,344.63
&amp;nbsp;16,385,555.20 38,409.44 76,656.82
;
Run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 01 Aug 2022 04:31:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-data-set-in-SAS/m-p/826378#M326412</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2022-08-01T04:31:24Z</dc:date>
    </item>
    <item>
      <title>Re: Create a data set in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-data-set-in-SAS/m-p/826380#M326413</link>
      <description>&lt;P&gt;1) If you can figure it out directly in Excel, do that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2) I don't see how creating a SAS data set with datalines / cards relates to importing an Excel sheet as data?&lt;/P&gt;</description>
      <pubDate>Mon, 01 Aug 2022 04:35:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-data-set-in-SAS/m-p/826380#M326413</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2022-08-01T04:35:30Z</dc:date>
    </item>
    <item>
      <title>Re: Create a data set in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-data-set-in-SAS/m-p/826382#M326414</link>
      <description>&lt;P&gt;Your numbers cannot be read with the default informat, you need to use the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/leforinforref/n1dvsmv8t9o60gn1dk1gkev91nan.htm" target="_blank" rel="noopener"&gt;COMMAw.&lt;/A&gt;&amp;nbsp;informat.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Aug 2022 04:38:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-data-set-in-SAS/m-p/826382#M326414</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-08-01T04:38:40Z</dc:date>
    </item>
    <item>
      <title>Re: Create a data set in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-data-set-in-SAS/m-p/826441#M326446</link>
      <description>I would like to create a data set by using cards statement and enter the values as I did.&lt;BR /&gt;May you please  help to create the data set correctly because now the values in data set are null</description>
      <pubDate>Mon, 01 Aug 2022 14:01:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-data-set-in-SAS/m-p/826441#M326446</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2022-08-01T14:01:36Z</dc:date>
    </item>
    <item>
      <title>Re: Create a data set in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-data-set-in-SAS/m-p/826444#M326448</link>
      <description>&lt;P&gt;Usage of informat:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Input (X1 X2 X3) (:comma20.);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This is all it takes.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Aug 2022 14:04:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-data-set-in-SAS/m-p/826444#M326448</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-08-01T14:04:50Z</dc:date>
    </item>
    <item>
      <title>Re: Create a data set in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-data-set-in-SAS/m-p/826448#M326450</link>
      <description>&lt;P&gt;To read strings with thousand separators as numbers use the COMMA &lt;STRONG&gt;informat&lt;/STRONG&gt;.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  input X1 X2 X3;
  informat x1-x3 comma.;
cards;
 22,532,091.84 97,797.96 9,338,743.32
 15,573,220.09 107,197.59 3,253,073.34
 17,601,372.44 170,123.33 2,157,860.99
 15,948,182.53 172,386.86 1,047,729.41
 10,297,115.52 162,988.85 570,263.86
 15,617,336.02 269,261.03 473,274.83
 10,795,404.83 330,659.42 274,623.30
 9,010,041.04 452,650.78 155,526.25
 2,389,875.61 217,180.51 20,502.96
 861,068,080.33 5,196,905.31 44,344.63
 16,385,555.20 38,409.44 76,656.82
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you want the values to display with the thousand separator also then you might want to attach the COMMA &lt;STRONG&gt;format&lt;/STRONG&gt; to the variables.&amp;nbsp; Make sure to count the decimal point and commas when calculating the width to use.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;format x1-x3 comma16.2 ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Aug 2022 14:18:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-data-set-in-SAS/m-p/826448#M326450</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-08-01T14:18:21Z</dc:date>
    </item>
  </channel>
</rss>

