<?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: SAS Studio - How to print first 5 rows of data in this code (OBS=x) does not work in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/SAS-Studio-How-to-print-first-5-rows-of-data-in-this-code-OBS-x/m-p/807703#M33645</link>
    <description>&lt;P&gt;Spaces wouldn't be an issue. The important bit is that it's within brackets for it to be syntax for a SAS dataset option. Without the brackets SAS will interpret it as an option for Proc Print - which doesn't exist to the code will fail.&lt;/P&gt;</description>
    <pubDate>Thu, 14 Apr 2022 02:59:44 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2022-04-14T02:59:44Z</dc:date>
    <item>
      <title>SAS Studio - How to print first 5 rows of data in this code (OBS=x) does not work</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-Studio-How-to-print-first-5-rows-of-data-in-this-code-OBS-x/m-p/807492#M33628</link>
      <description>&lt;P&gt;After sorting the rows, I want to PRINT the top 5 rows only (the top five highest values for FacilityCountry).&amp;nbsp; I have tried to use (OBS=5) in the PROC PRINT date= statement, but it does not work.&amp;nbsp; Looking for ideas.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;DATA MIS543.TOYS2;&lt;BR /&gt;	SET MIS543.TOYS;&lt;BR /&gt;	KEEP FacilityCountry Sales;&lt;BR /&gt;RUN;&lt;BR /&gt;&lt;BR /&gt;PROC REPORT DATA=MIS543.TOYS2 OUT=MIS543.TOYSTABLE;&lt;BR /&gt;	column FacilityCountry Sales;&lt;BR /&gt;		define FacilityCountry / "Country" group order=data;&lt;BR /&gt;		define Sales / "Sales" sum;&lt;BR /&gt;	format Sales DOLLAR14.;&lt;BR /&gt;RUN;&lt;BR /&gt;&lt;BR /&gt;PROC SORT DATA=MIS543.TOYSTABLE;&lt;BR /&gt;	BY descending Sales;&lt;BR /&gt;RUN;&lt;BR /&gt;&lt;BR /&gt;PROC PRINT DATA=MIS543.TOYSTABLE LABEL NOOBS style(header obsheader)=[fontsize=4 color= darkgreen backgroundcolor=lightcyan];&lt;BR /&gt;	VAR FacilityCountry / style(data)=[fontsize=3 fontweight=bold color=DARKGREEN];&lt;BR /&gt;	VAR Sales / style(data)=[fontsize=3 fontweight=bold color=DARKGREEN];&lt;BR /&gt;	title c=darkgreen bold h=5 "Top Five Countries with the Most Sales";&lt;BR /&gt;RUN;&lt;BR /&gt;TITLE;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2022 20:22:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-Studio-How-to-print-first-5-rows-of-data-in-this-code-OBS-x/m-p/807492#M33628</guid>
      <dc:creator>tmccombs27</dc:creator>
      <dc:date>2022-04-12T20:22:30Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Studio - How to print first 5 rows of data in this code (OBS=x) does not work</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-Studio-How-to-print-first-5-rows-of-data-in-this-code-OBS-x/m-p/807500#M33629</link>
      <description>&lt;P&gt;Use OBS=5 as a SAS dataset option.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC PRINT DATA=MIS543.TOYSTABLE(obs=5) ....&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 Apr 2022 21:20:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-Studio-How-to-print-first-5-rows-of-data-in-this-code-OBS-x/m-p/807500#M33629</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2022-04-12T21:20:35Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Studio - How to print first 5 rows of data in this code (OBS=x) does not work</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-Studio-How-to-print-first-5-rows-of-data-in-this-code-OBS-x/m-p/807502#M33630</link>
      <description>&lt;P&gt;Doesn't work is awful vague.&lt;BR /&gt;&lt;BR /&gt;Are there errors in the log?: Post the code and log in a code box opened with the "&amp;lt;/&amp;gt;" to maintain formatting of error messages.&lt;BR /&gt;&lt;BR /&gt;No output? Post any log in a code box.&lt;BR /&gt;&lt;BR /&gt;Unexpected output? Provide input data in the form of data step code pasted into a code box, the actual results and the expected results. Instructions here: &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt; will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the "&amp;lt;/&amp;gt;" icon or attached as text to show exactly what you have and that we can test code against.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since OBS= has been for a very long time one strongly suspects the attempt you actually made was syntactically incorrect but you haven't shown any code with that option to allow pointing out exactly where.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that there really isn't any reason to create that subset data set of MIS543.Toys2 for input into Proc Report. Report will only use the variables the reference.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2022 21:29:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-Studio-How-to-print-first-5-rows-of-data-in-this-code-OBS-x/m-p/807502#M33630</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-04-12T21:29:46Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Studio - How to print first 5 rows of data in this code (OBS=x) does not work</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-Studio-How-to-print-first-5-rows-of-data-in-this-code-OBS-x/m-p/807690#M33643</link>
      <description>&lt;P&gt;I guess I had to be exact on where to place the code (directly after the data= file with no space.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Apr 2022 22:12:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-Studio-How-to-print-first-5-rows-of-data-in-this-code-OBS-x/m-p/807690#M33643</guid>
      <dc:creator>tmccombs27</dc:creator>
      <dc:date>2022-04-13T22:12:08Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Studio - How to print first 5 rows of data in this code (OBS=x) does not work</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-Studio-How-to-print-first-5-rows-of-data-in-this-code-OBS-x/m-p/807703#M33645</link>
      <description>&lt;P&gt;Spaces wouldn't be an issue. The important bit is that it's within brackets for it to be syntax for a SAS dataset option. Without the brackets SAS will interpret it as an option for Proc Print - which doesn't exist to the code will fail.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2022 02:59:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-Studio-How-to-print-first-5-rows-of-data-in-this-code-OBS-x/m-p/807703#M33645</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2022-04-14T02:59:44Z</dc:date>
    </item>
  </channel>
</rss>

