<?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 Output statement and Out= Procedure option in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Output-Statement-amp-Out-procedure-option/m-p/262653#M57682</link>
    <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A. Can anyone tell me when we use:&lt;/P&gt;&lt;P&gt;1. Output statement.&lt;/P&gt;&lt;P&gt;2. Out= (procedure option) and,&lt;/P&gt;&lt;P&gt;3. Output Out=&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;B. Can we use all 3 statements/options in SAS DATA sets?&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; By SAS DATA SET I mean for example:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; data male female;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; set demographic;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; if gender = 'F' then output female;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; if gender = 'M' then output male;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;C. Can we&amp;nbsp;&lt;SPAN&gt;use all 3 statements/options in SAS Procedures?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;D. 'Output out = ' is a procedure option or a statement?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Please give me some examples also, if possible.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Ramanuj&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 09 Apr 2016 10:10:00 GMT</pubDate>
    <dc:creator>Ramanuj_Khatri</dc:creator>
    <dc:date>2016-04-09T10:10:00Z</dc:date>
    <item>
      <title>Output Statement &amp; Out= procedure option.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Output-Statement-amp-Out-procedure-option/m-p/262652#M57679</link>
      <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A. Can anyone tell me when we use:&lt;/P&gt;&lt;P&gt;1. Output statement.&lt;/P&gt;&lt;P&gt;2. Out= (procedure option) and,&lt;/P&gt;&lt;P&gt;3. Output Out=&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;B. Can we use all 3 statements/options in SAS DATA sets?&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; By SAS DATA SET I mean for example:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; data male female;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; set demographic;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; if gender = 'F' then output female;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; if gender = 'M' then output male;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;C. Can we&amp;nbsp;&lt;SPAN&gt;use all 3 statements/options in SAS Procedures?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;D. 'Output out = ' is a procedure option or a statement?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Please give me some examples also, if possible.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Ramanuj&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 09 Apr 2016 09:56:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Output-Statement-amp-Out-procedure-option/m-p/262652#M57679</guid>
      <dc:creator>Ramanuj_Khatri</dc:creator>
      <dc:date>2016-04-09T09:56:06Z</dc:date>
    </item>
    <item>
      <title>Output statement and Out= Procedure option</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Output-Statement-amp-Out-procedure-option/m-p/262653#M57682</link>
      <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A. Can anyone tell me when we use:&lt;/P&gt;&lt;P&gt;1. Output statement.&lt;/P&gt;&lt;P&gt;2. Out= (procedure option) and,&lt;/P&gt;&lt;P&gt;3. Output Out=&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;B. Can we use all 3 statements/options in SAS DATA sets?&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; By SAS DATA SET I mean for example:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; data male female;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; set demographic;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; if gender = 'F' then output female;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; if gender = 'M' then output male;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;C. Can we&amp;nbsp;&lt;SPAN&gt;use all 3 statements/options in SAS Procedures?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;D. 'Output out = ' is a procedure option or a statement?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Please give me some examples also, if possible.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Ramanuj&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 09 Apr 2016 10:10:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Output-Statement-amp-Out-procedure-option/m-p/262653#M57682</guid>
      <dc:creator>Ramanuj_Khatri</dc:creator>
      <dc:date>2016-04-09T10:10:00Z</dc:date>
    </item>
    <item>
      <title>Re: Output statement and Out= Procedure option</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Output-Statement-amp-Out-procedure-option/m-p/262657#M57683</link>
      <description>&lt;P&gt;Hi &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/75858"&gt;@Ramanuj_Khatri﻿&lt;/a&gt; please avoid cross-posting. Answering the question is so much harder for a community. Please consider removing one version.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards, Jan.&lt;/P&gt;</description>
      <pubDate>Sat, 09 Apr 2016 11:15:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Output-Statement-amp-Out-procedure-option/m-p/262657#M57683</guid>
      <dc:creator>jklaverstijn</dc:creator>
      <dc:date>2016-04-09T11:15:21Z</dc:date>
    </item>
    <item>
      <title>Re: Output Statement &amp; Out= procedure option.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Output-Statement-amp-Out-procedure-option/m-p/262658#M57680</link>
      <description>&lt;DIV id="messagebodydisplay_0_0" class="lia-message-body lia-component-body"&gt;
&lt;DIV class="lia-message-body-content"&gt;
&lt;P&gt;Hi &lt;A href="https://communities.sas.com/t5/user/viewprofilepage/user-id/75858" target="_blank"&gt;@Ramanuj_Khatri&lt;/A&gt; please avoid cross-posting. Answering the question is so much harder for a community. Please consider removing one version.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards, Jan.&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Sat, 09 Apr 2016 11:23:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Output-Statement-amp-Out-procedure-option/m-p/262658#M57680</guid>
      <dc:creator>jklaverstijn</dc:creator>
      <dc:date>2016-04-09T11:23:53Z</dc:date>
    </item>
    <item>
      <title>Re: Output Statement &amp; Out= procedure option.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Output-Statement-amp-Out-procedure-option/m-p/262661#M57681</link>
      <description>All your question can easily be found in SAS documentation and can be as easily verified by testing in a SAS session.</description>
      <pubDate>Sat, 09 Apr 2016 11:29:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Output-Statement-amp-Out-procedure-option/m-p/262661#M57681</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-04-09T11:29:45Z</dc:date>
    </item>
    <item>
      <title>Re: Output Statement &amp; Out= procedure option.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Output-Statement-amp-Out-procedure-option/m-p/262670#M57684</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/75858"&gt;@Ramanuj_Khatri﻿&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You're probably familiar with other programming languages which have essentially &lt;EM&gt;one&lt;/EM&gt; set of statements, functions etc. SAS (more precisely: the SAS programming language) is different from those languages. There is only little overlap between the DATA step language and language elements used in SAS procedures. Moreover, each procedure has its own syntax. There are similarities between certain procedures, but the &lt;A href="http://support.sas.com/documentation/cdl/en/proc/68954/HTML/default/viewer.htm#n0wztgdi7emiovn11j1pdodxd872.htm" target="_blank"&gt;list of statements with the same function in multiple (Base SAS) procedures&lt;/A&gt;&amp;nbsp;is short.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Therefore, I think, the basic picture to start with is&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;DATA step&lt;/LI&gt;
&lt;LI&gt;procedures:&lt;BR /&gt;- PROC CONTENTS&lt;BR /&gt; - PROC PRINT&lt;BR /&gt; - PROC SORT&lt;BR /&gt; - PROC FREQ&lt;BR /&gt; etc.&lt;/LI&gt;
&lt;LI&gt;global statements (LIBNAME, TITLE, OPTIONS, etc.) and comments&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Natural&lt;/EM&gt; questions would be "How can I ...?"&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;derive a new quantity from existing values&lt;/LI&gt;
&lt;LI&gt;compute group means of a series of measurements&lt;/LI&gt;
&lt;LI&gt;display data of selected subjects&lt;BR /&gt;...&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;The answers to such questions will lead you to syntax elements. When you read about the syntax, e.g., of a particular procedure statement, it is a good idea to quickly look through other syntax elements of the same procedure that may be useful later.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As to your questions:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;A1. There is an &lt;A href="http://support.sas.com/documentation/cdl//en/lestmtsref/68024/HTML/default/viewer.htm#n1lltvbis7ye1an1eryo4leh2mck.htm" target="_blank"&gt;OUTPUT statement in the DATA step&lt;/A&gt; (which writes the current observation to a dataset) and there are OUTPUT statements in many procedures (see &lt;A href="http://support.sas.com/documentation/cdl/en/syntaxidx/68719/HTML/default/index.htm#/documentation/cdl/en/syntaxidx/68719/HTML/default/term/term7497.htm" target="_blank"&gt;this list&lt;/A&gt;), but they are completely separate.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A2, A3. As described above, each procedure has its own syntax. Some procedures have statements with an OUT= option to create a dataset containing procedure results.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;B. SAS &lt;EM&gt;datasets&lt;/EM&gt; contain data. What you describe is a &lt;EM&gt;DATA step&lt;/EM&gt; containing a SET statement. Only the OUTPUT statement (of the DATA step) is valid here, no procedure syntax.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;C. Not all procedures have an OUTPUT statement or statements with an OUT= option (e.g. PROC MEANS: yes, PROC PRINT: no).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;D. OUT= in procedures (if existent) is always an option of a statement. For example, in PROC FREQ both the TABLES statement and the OUTPUT statement have an OUT= option.&lt;/P&gt;</description>
      <pubDate>Sat, 09 Apr 2016 13:12:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Output-Statement-amp-Out-procedure-option/m-p/262670#M57684</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2016-04-09T13:12:34Z</dc:date>
    </item>
    <item>
      <title>Re: Output Statement &amp; Out= procedure option.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Output-Statement-amp-Out-procedure-option/m-p/262674#M57685</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A. Is it true that output statement (without an out= option) is valid only in DATA Steps. If no, then,&lt;BR /&gt;please describe me (don't give only names) atleast two examples of sas procedures where no 'out=' option is required after output statement.&lt;BR /&gt;However, I know that: If the OUT= (or DATA=) option is omitted, the procedure uses the DATAn convention to name the output data set.&amp;nbsp;So, please don't use proc means, proc summary etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And please, ignore this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;B. Can we use all 3 statements/options in SAS DATA sets?&lt;BR /&gt;By SAS DATA SET I mean for example:&lt;BR /&gt;data male female;&lt;BR /&gt;set demographic;&lt;BR /&gt;if gender = 'F' then output female;&lt;BR /&gt;if gender = 'M' then output male;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And, consider this as: Can we use out= or output out= in DATA &lt;EM&gt;&lt;STRONG&gt;steps&lt;/STRONG&gt;&lt;/EM&gt;? If yes, then please give me 1 or 2 examples.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Ramanuj&lt;/P&gt;</description>
      <pubDate>Sat, 09 Apr 2016 14:09:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Output-Statement-amp-Out-procedure-option/m-p/262674#M57685</guid>
      <dc:creator>Ramanuj_Khatri</dc:creator>
      <dc:date>2016-04-09T14:09:44Z</dc:date>
    </item>
    <item>
      <title>Re: Output Statement &amp; Out= procedure option.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Output-Statement-amp-Out-procedure-option/m-p/262676#M57686</link>
      <description>Thanks for your last answer.</description>
      <pubDate>Sat, 09 Apr 2016 14:10:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Output-Statement-amp-Out-procedure-option/m-p/262676#M57686</guid>
      <dc:creator>Ramanuj_Khatri</dc:creator>
      <dc:date>2016-04-09T14:10:58Z</dc:date>
    </item>
    <item>
      <title>Re: Output Statement &amp; Out= procedure option.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Output-Statement-amp-Out-procedure-option/m-p/262684#M57687</link>
      <description>&lt;P&gt;I can only reiterate that the OUTPUT&amp;nbsp;statement of the DATA step and the OUTPUT statements found in some SAS procedures have little in common except their name. It would be a misconception to think of "&lt;EM&gt;the&lt;/EM&gt; OUTPUT statement" as a language element shared by the DATA step and some SAS procedures.&amp;nbsp;Maybe it would avoid confusion if the OUTPUT statement of the DATA step was rather&amp;nbsp;called "WRITE" or something.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could go through the long &lt;A href="http://support.sas.com/documentation/cdl/en/syntaxidx/68719/HTML/default/index.htm#/documentation/cdl/en/syntaxidx/68719/HTML/default/term/term7497.htm" target="_blank" rel="nofollow"&gt;list&lt;/A&gt;&amp;nbsp;of SAS procedures which have an OUTPUT statement (linked also in&amp;nbsp;my previous post) and try to find one without an OUT= option, but for what purpose? From the top of my head (but I haven't used every procedure in&amp;nbsp;that list) I guess that each of these OUTPUT&amp;nbsp;statements has an OUT= option. Obviously, the "output" must be written somewhere and an output &lt;EM&gt;dataset&lt;/EM&gt; makes much sense, hence there is a need to specify the dataset name. For consistency, the pertinent option of the OUTPUT statements was named OUT= in many if not all SAS procedures which have an OUTPUT statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, yes, if you encounter a line of SAS code that reads &lt;FONT face="courier new,courier"&gt;output;&lt;/FONT&gt; or &lt;FONT face="courier new,courier"&gt;output &lt;EM&gt;abc&lt;/EM&gt;;&lt;/FONT&gt;&amp;nbsp;you're most likely reading a DATA step. (You mentioned the rare exception of the default-named DATAn datasets&amp;nbsp;created by&amp;nbsp;PROC steps yourself.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The OUTPUT&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;statement of the DATA step does not have any options (&lt;A href="http://support.sas.com/documentation/cdl/en/syntaxidx/68719/HTML/default/index.htm#/documentation/cdl//en/lestmtsref/68024/HTML/default/n1lltvbis7ye1an1eryo4leh2mck.htm" target="_blank"&gt;SAS 9.4 documentation&lt;/A&gt;), in particular no&amp;nbsp;&lt;/SPAN&gt;OUT= option.&lt;/P&gt;</description>
      <pubDate>Sat, 09 Apr 2016 15:15:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Output-Statement-amp-Out-procedure-option/m-p/262684#M57687</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2016-04-09T15:15:32Z</dc:date>
    </item>
  </channel>
</rss>

