<?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: Print Data from an excel file in SAS Studio. in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/Print-Data-from-an-excel-file-in-SAS-Studio/m-p/591958#M8021</link>
    <description>&lt;P&gt;Import Excel data into a SAS dataset and use obs=50 as a dataset option when using proc print to print the dataset.&lt;/P&gt;
&lt;P&gt;Assign proper formats to the variables in question. The documentation of formats is found &lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=leforinforref&amp;amp;docsetTarget=n0p2fmevfgj470n17h4k9f27qjag.htm&amp;amp;locale=en" target="_blank" rel="noopener"&gt;here&lt;/A&gt;.&lt;/P&gt;</description>
    <pubDate>Thu, 26 Sep 2019 18:46:07 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2019-09-26T18:46:07Z</dc:date>
    <item>
      <title>Print Data from an excel file in SAS Studio.</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Print-Data-from-an-excel-file-in-SAS-Studio/m-p/591951#M8020</link>
      <description>&lt;P&gt;Hi. How can I print first 50 rows of a worksheet in an excel sheet in SAS Studio? And for the data selected from the worksheet, how to print the Date as mm/dd/yy, and Gross with dollar signs and commas. I'm using the University Edition. Thank you so much.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Sep 2019 18:38:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Print-Data-from-an-excel-file-in-SAS-Studio/m-p/591951#M8020</guid>
      <dc:creator>aabbccwyt</dc:creator>
      <dc:date>2019-09-26T18:38:04Z</dc:date>
    </item>
    <item>
      <title>Re: Print Data from an excel file in SAS Studio.</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Print-Data-from-an-excel-file-in-SAS-Studio/m-p/591958#M8021</link>
      <description>&lt;P&gt;Import Excel data into a SAS dataset and use obs=50 as a dataset option when using proc print to print the dataset.&lt;/P&gt;
&lt;P&gt;Assign proper formats to the variables in question. The documentation of formats is found &lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=leforinforref&amp;amp;docsetTarget=n0p2fmevfgj470n17h4k9f27qjag.htm&amp;amp;locale=en" target="_blank" rel="noopener"&gt;here&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Sep 2019 18:46:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Print-Data-from-an-excel-file-in-SAS-Studio/m-p/591958#M8021</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-09-26T18:46:07Z</dc:date>
    </item>
    <item>
      <title>Re: Print Data from an excel file in SAS Studio.</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Print-Data-from-an-excel-file-in-SAS-Studio/m-p/591961#M8022</link>
      <description>1. First import the data, PROC IMPORT or LIBNAME&lt;BR /&gt;2. PROC PRINT with the OBS= option. &lt;BR /&gt;3. FORMAT statements to control display. &lt;BR /&gt;&lt;BR /&gt;proc print data=sashelp.class (obs=10);&lt;BR /&gt;format weight 8.1;&lt;BR /&gt;format age dollar12.;&lt;BR /&gt;run;</description>
      <pubDate>Thu, 26 Sep 2019 18:48:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Print-Data-from-an-excel-file-in-SAS-Studio/m-p/591961#M8022</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-09-26T18:48:32Z</dc:date>
    </item>
    <item>
      <title>Re: Print Data from an excel file in SAS Studio.</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Print-Data-from-an-excel-file-in-SAS-Studio/m-p/592017#M8025</link>
      <description>&lt;P&gt;Here is what I have:&lt;/P&gt;&lt;P&gt;proc print data=work.Movie_2019 (obs=15);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;format MMDDYY10. ;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;format DOLLARw.d ;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;format COMMAw.d;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It gives the error message:&lt;/P&gt;&lt;DIV class="sasError"&gt;ERROR 22-322: Syntax error, expecting one of the following: a name, _ALL_, _CHARACTER_, _CHAR_, _NUMERIC_.&lt;/DIV&gt;&lt;DIV class="sasError"&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;/DIV&gt;&lt;DIV class="sasError"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;The requirements are to have the Date printing as mmddyy, so I use the format MMDD10.; Gross with dollar signs and commas, so I use the formats DOLLARw.d and COMMAw.d&lt;/DIV&gt;</description>
      <pubDate>Thu, 26 Sep 2019 20:38:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Print-Data-from-an-excel-file-in-SAS-Studio/m-p/592017#M8025</guid>
      <dc:creator>aabbccwyt</dc:creator>
      <dc:date>2019-09-26T20:38:59Z</dc:date>
    </item>
    <item>
      <title>Re: Print Data from an excel file in SAS Studio.</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Print-Data-from-an-excel-file-in-SAS-Studio/m-p/592019#M8026</link>
      <description>&lt;P&gt;To assign a format to a variable, you need to have both the variable name and the format in the format statement.&lt;/P&gt;
&lt;P&gt;See the &lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=lestmtsref&amp;amp;docsetTarget=n0d5oq7e0oia0wn13nsins0x8nmh.htm&amp;amp;locale=en" target="_blank" rel="noopener"&gt;documentation for this&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Sep 2019 20:43:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Print-Data-from-an-excel-file-in-SAS-Studio/m-p/592019#M8026</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-09-26T20:43:09Z</dc:date>
    </item>
    <item>
      <title>Re: Print Data from an excel file in SAS Studio.</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Print-Data-from-an-excel-file-in-SAS-Studio/m-p/592034#M8030</link>
      <description>&lt;P&gt;Is this correct?&lt;/P&gt;&lt;P&gt;proc print data=work.Movie_2019 (obs=50);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; format ReleaseData MMDDYY10.;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;Or should there be space or _ between &lt;STRONG&gt;Release&lt;/STRONG&gt; and &lt;STRONG&gt;Data&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Sep 2019 21:20:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Print-Data-from-an-excel-file-in-SAS-Studio/m-p/592034#M8030</guid>
      <dc:creator>aabbccwyt</dc:creator>
      <dc:date>2019-09-26T21:20:32Z</dc:date>
    </item>
    <item>
      <title>Re: Print Data from an excel file in SAS Studio.</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Print-Data-from-an-excel-file-in-SAS-Studio/m-p/592035#M8031</link>
      <description>Do you have two variables or one?&lt;BR /&gt;You need to list each variable separated by a space if you want multiple variables to have one format.</description>
      <pubDate>Thu, 26 Sep 2019 21:28:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Print-Data-from-an-excel-file-in-SAS-Studio/m-p/592035#M8031</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-09-26T21:28:42Z</dc:date>
    </item>
    <item>
      <title>Re: Print Data from an excel file in SAS Studio.</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Print-Data-from-an-excel-file-in-SAS-Studio/m-p/592037#M8033</link>
      <description>&lt;P&gt;I have only one variable, however, the title of the variable in the excel sheet is "Release Date". I'm struggling with the format. Should it be Release Data, Release_Data or ReleaseData? Or should I do something else? Thank you.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Sep 2019 21:38:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Print-Data-from-an-excel-file-in-SAS-Studio/m-p/592037#M8033</guid>
      <dc:creator>aabbccwyt</dc:creator>
      <dc:date>2019-09-26T21:38:55Z</dc:date>
    </item>
    <item>
      <title>Re: Print Data from an excel file in SAS Studio.</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Print-Data-from-an-excel-file-in-SAS-Studio/m-p/592043#M8035</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/292388"&gt;@aabbccwyt&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have only one variable, however, the title of the variable in the excel sheet is "Release Date". I'm struggling with the format. Should it be Release Data, Release_Data or ReleaseData? Or should I do something else? Thank you.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Then you need to use a so-called "name literal", which allows to use almost any crap as a variable name:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;format "Release Date"n mmddyy10.;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 26 Sep 2019 22:05:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Print-Data-from-an-excel-file-in-SAS-Studio/m-p/592043#M8035</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-09-26T22:05:53Z</dc:date>
    </item>
    <item>
      <title>Re: Print Data from an excel file in SAS Studio.</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Print-Data-from-an-excel-file-in-SAS-Studio/m-p/592047#M8036</link>
      <description>&lt;P&gt;I think I have everything right, however, the format is still wrong. Can you please check my code to see if there is anything wrong? Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc import datafile="/home/Movies_Database_2018.xlsx"&lt;BR /&gt;dbms=xlsx out=Movies_2018 replace;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc print data=Movies_2018 (obs=50);&lt;BR /&gt;format Gross dollar2.;&lt;BR /&gt;format Gross comma10.;&lt;BR /&gt;format "Release Data"n mmddyy10.;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The data is just fine, just the format is not correct at all. No error, just a warning says " Variable 'Release Data'n not found in data set MOVIES_2018.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Sep 2019 22:31:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Print-Data-from-an-excel-file-in-SAS-Studio/m-p/592047#M8036</guid>
      <dc:creator>aabbccwyt</dc:creator>
      <dc:date>2019-09-26T22:31:09Z</dc:date>
    </item>
    <item>
      <title>Re: Print Data from an excel file in SAS Studio.</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Print-Data-from-an-excel-file-in-SAS-Studio/m-p/592092#M8040</link>
      <description>&lt;P&gt;View the dataset to see the variable name with which it was imported, or run proc contents on it and look at the results.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Sep 2019 06:21:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Print-Data-from-an-excel-file-in-SAS-Studio/m-p/592092#M8040</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-09-27T06:21:44Z</dc:date>
    </item>
    <item>
      <title>Re: Print Data from an excel file in SAS Studio.</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Print-Data-from-an-excel-file-in-SAS-Studio/m-p/592202#M8044</link>
      <description>&lt;P&gt;Don't guess your names and variable types, check it explicitly. &lt;STRONG&gt;Especially from Excel files&lt;/STRONG&gt; because then SAS guesses at types, whereas with a text file you can control the type.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Run a proc contents on your data set that you imported and it will list the variable names and labels.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc contents data=movies_2018;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you're still having issues after this, please post the output from PROC CONTENTS to the forum.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/292388"&gt;@aabbccwyt&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I think I have everything right, however, the format is still wrong. Can you please check my code to see if there is anything wrong? Thank you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc import datafile="/home/Movies_Database_2018.xlsx"&lt;BR /&gt;dbms=xlsx out=Movies_2018 replace;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc print data=Movies_2018 (obs=50);&lt;BR /&gt;format Gross dollar2.;&lt;BR /&gt;format Gross comma10.;&lt;BR /&gt;format "Release Data"n mmddyy10.;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The data is just fine, just the format is not correct at all. No error, just a warning says " Variable 'Release Data'n not found in data set MOVIES_2018.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Sep 2019 15:34:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Print-Data-from-an-excel-file-in-SAS-Studio/m-p/592202#M8044</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-09-27T15:34:05Z</dc:date>
    </item>
    <item>
      <title>Re: Print Data from an excel file in SAS Studio.</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Print-Data-from-an-excel-file-in-SAS-Studio/m-p/592235#M8046</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;The data is just fine, just the format is not correct at all. No error, just a warning says " Variable 'Release Data'n not found in data set MOVIES_2018.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;Why did you reference a variable that doesn't exist?&amp;nbsp; Could be just a typo. I doubt that the name is 'Release Dat&lt;STRONG&gt;a&lt;/STRONG&gt;'n for a value that has a date in it.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Make sure not to use the LABEL of the variable instead of the NAME of the variable.&amp;nbsp; The setting of the VALIDVARNAME option will determine whether SAS will create a variable named 'Release Date'n or Release_Date, but in either case the label will reflect the column header in the Excel file.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Also why are you using two different FORMAT statements for the variable GROSS?&amp;nbsp; Which way would you like it to display the values?&amp;nbsp; With or without DOLLAR signs?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Sep 2019 16:49:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Print-Data-from-an-excel-file-in-SAS-Studio/m-p/592235#M8046</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-09-27T16:49:46Z</dc:date>
    </item>
  </channel>
</rss>

