<?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: Executing a PROC from a DATA Step in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Executing-a-PROC-from-a-DATA-Step/m-p/274627#M54838</link>
    <description>Thank you for your reply to my question.&lt;BR /&gt;&lt;BR /&gt;I will check each suggested solution and then confirm.&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;&lt;BR /&gt;##- Please type your reply above this line. Simple formatting, no&lt;BR /&gt;attachments. -##</description>
    <pubDate>Thu, 02 Jun 2016 12:12:06 GMT</pubDate>
    <dc:creator>JonDickens1607</dc:creator>
    <dc:date>2016-06-02T12:12:06Z</dc:date>
    <item>
      <title>Executing a PROC from a DATA Step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Executing-a-PROC-from-a-DATA-Step/m-p/274511#M54797</link>
      <description>&lt;P&gt;I would like to use Arrays in a SAS Data Step as I need to apply the same method to a set of variables&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However the method involves a SAS PROC.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My visualisation of the pseudo code is as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data Percentile_output;&lt;/P&gt;&lt;P&gt;set Data12345&lt;/P&gt;&lt;P&gt;{array SQ definition here }&lt;/P&gt;&lt;P&gt;Do K = 1 to 60&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; Proc Univariate&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Data =&amp;nbsp;Data12345;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Output pctlpts = 20 40 60 80;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; var SQ[k];&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Output table:&lt;/P&gt;&lt;P&gt;sq01 &amp;nbsp;sq02 &amp;nbsp;... sq60&lt;/P&gt;&lt;P&gt;p20 &amp;nbsp; p20 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;p20&lt;/P&gt;&lt;P&gt;p40 &amp;nbsp; p40 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; p40&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;p80 &amp;nbsp; p80 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;p80&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any Suggestions?&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jun 2016 22:51:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Executing-a-PROC-from-a-DATA-Step/m-p/274511#M54797</guid>
      <dc:creator>JonDickens1607</dc:creator>
      <dc:date>2016-06-01T22:51:10Z</dc:date>
    </item>
    <item>
      <title>Re: Executing a PROC from a DATA Step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Executing-a-PROC-from-a-DATA-Step/m-p/274522#M54802</link>
      <description>&lt;P&gt;No need ARRAY.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Proc Univariate Data = sashelp.class noprint;
var age weight height;
Output out=temp pctlpre=age_ weight_ height_   pctlpts = 20 40 60 80;
run;
proc transpose data=temp out=temp1;
run;
data temp2;
 set temp1;
 name=scan(_name_,1,'_');
 pctl=scan(_name_,2,'_');
run;
proc transpose data=temp2 out=want;
 by pctl;
 id name;
 var col1;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or It is very convenient for IML . Do you like it ?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc iml;
use sashelp.class;
read all var{age weight height} into x[c=vnames];
close;

call qntl(q,x,{.2 .4 .6 .8});

print q[c=vnames r={p20 p40 p60 p80} l=''];
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/3448i7C0F087B9611FAA2/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="x.png" title="x.png" /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jun 2016 01:28:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Executing-a-PROC-from-a-DATA-Step/m-p/274522#M54802</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-06-02T01:28:03Z</dc:date>
    </item>
    <item>
      <title>Re: Executing a PROC from a DATA Step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Executing-a-PROC-from-a-DATA-Step/m-p/274533#M54806</link>
      <description>&lt;P&gt;If the data is the same you only need a proc, since it can handle multiple variables at once. Unfortunately the data isn't in the form you want so a proc transpose is required to flip it.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp﻿&lt;/a&gt;&amp;nbsp;code demonstrates this.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you need to process different datasets then you use a macro.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There isn't a way to embed a proc inside a data step in the way you're envisioning.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jun 2016 02:18:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Executing-a-PROC-from-a-DATA-Step/m-p/274533#M54806</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-06-02T02:18:33Z</dc:date>
    </item>
    <item>
      <title>Re: Executing a PROC from a DATA Step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Executing-a-PROC-from-a-DATA-Step/m-p/274627#M54838</link>
      <description>Thank you for your reply to my question.&lt;BR /&gt;&lt;BR /&gt;I will check each suggested solution and then confirm.&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;&lt;BR /&gt;##- Please type your reply above this line. Simple formatting, no&lt;BR /&gt;attachments. -##</description>
      <pubDate>Thu, 02 Jun 2016 12:12:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Executing-a-PROC-from-a-DATA-Step/m-p/274627#M54838</guid>
      <dc:creator>JonDickens1607</dc:creator>
      <dc:date>2016-06-02T12:12:06Z</dc:date>
    </item>
  </channel>
</rss>

