<?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 SAS Proc steps with the data step in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-Proc-steps-with-the-data-step/m-p/833421#M329464</link>
    <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have following step in proc sql.&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can we get this step in one datastep instead of data and sort procedure&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;/*Have*/
proc Sql noprint;
	create table cars as 
		select * from sashelp.cars
			where upcase(make)="%upcase(HONDA)"
				order by length, mpg_city, mpg_highway; /*Replaced element with study_arm_desc variable. DT*/
quit;


/*want*/

data cars;
set sashelp.cars;
if make = "Honda";
*to add sort steps in this step;
run;

proc sort data=cars;
by length, mpg_city, mpg_highway;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 14 Sep 2022 19:29:00 GMT</pubDate>
    <dc:creator>dht115</dc:creator>
    <dc:date>2022-09-14T19:29:00Z</dc:date>
    <item>
      <title>SAS Proc steps with the data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Proc-steps-with-the-data-step/m-p/833421#M329464</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have following step in proc sql.&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can we get this step in one datastep instead of data and sort procedure&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;/*Have*/
proc Sql noprint;
	create table cars as 
		select * from sashelp.cars
			where upcase(make)="%upcase(HONDA)"
				order by length, mpg_city, mpg_highway; /*Replaced element with study_arm_desc variable. DT*/
quit;


/*want*/

data cars;
set sashelp.cars;
if make = "Honda";
*to add sort steps in this step;
run;

proc sort data=cars;
by length, mpg_city, mpg_highway;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2022 19:29:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Proc-steps-with-the-data-step/m-p/833421#M329464</guid>
      <dc:creator>dht115</dc:creator>
      <dc:date>2022-09-14T19:29:00Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Proc steps with the data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Proc-steps-with-the-data-step/m-p/833422#M329465</link>
      <description>&lt;P&gt;How about this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=sashelp.cars out=cars;
    where make='Honda';
    by length mpg_city mpg_highway;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, your SQL code can be simplified with&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where upcase(make)="HONDA"&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or better yet&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where make='Honda'&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Sep 2022 19:40:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Proc-steps-with-the-data-step/m-p/833422#M329465</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-09-14T19:40:46Z</dc:date>
    </item>
  </channel>
</rss>

