<?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: PUT,INPUT AND SCAN in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/PUT-INPUT-AND-SCAN/m-p/431217#M106617</link>
    <description>&lt;P&gt;Show and example of what you mean.&lt;/P&gt;</description>
    <pubDate>Fri, 26 Jan 2018 11:36:42 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2018-01-26T11:36:42Z</dc:date>
    <item>
      <title>PUT,INPUT AND SCAN</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PUT-INPUT-AND-SCAN/m-p/427961#M105598</link>
      <description>&lt;P&gt;data m;&lt;BR /&gt;input info $ 1 - 50;&lt;BR /&gt;cards;&lt;BR /&gt;101 pencils 39&lt;BR /&gt;102 parker pens 21&lt;BR /&gt;103 apple ipod touch &amp;amp; shuffle 09&lt;BR /&gt;104 dell studio laptop 03&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*get the starting nos as pr_id, ending nos as pr_qty and the rest as pr_name*/&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2018 09:59:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PUT-INPUT-AND-SCAN/m-p/427961#M105598</guid>
      <dc:creator>VISHNU239</dc:creator>
      <dc:date>2018-01-16T09:59:01Z</dc:date>
    </item>
    <item>
      <title>Re: PUT,INPUT AND SCAN</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PUT-INPUT-AND-SCAN/m-p/427966#M105600</link>
      <description>&lt;P&gt;One way&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
	set m;
	pr_id=scan(info, 1);
	pr_qty=scan(info, -1);
	pr_name=substr(info, findw(info, scan(info, 2)), findw(info, scan(info, -1))-findw(info, scan(info, 2)));
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 16 Jan 2018 10:22:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PUT-INPUT-AND-SCAN/m-p/427966#M105600</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2018-01-16T10:22:08Z</dc:date>
    </item>
    <item>
      <title>Re: PUT,INPUT AND SCAN</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PUT-INPUT-AND-SCAN/m-p/427975#M105604</link>
      <description>&lt;P&gt;Another possibility is to use PRX functions, which enables you&amp;nbsp;to check for numbers in the right places:&lt;/P&gt;&lt;PRE&gt;data want;
  set m;
  length pr_id $5 pr_name $40 pr_qty $5;
  prxid=prxparse('/^(\d+) (.+) (\d+)\s*$/');
  if not prxmatch(prxid,info) then
    error 'No match';
  else do;
    pr_id=prxposn(prxid,1,info);
    pr_name=prxposn(prxid,2,info);
    pr_qty=prxposn(prxid,3,info);
    end;
  keep info pr_:;
run;&lt;/PRE&gt;&lt;P&gt;The PRX string searches for beginning of string "^", some digits&amp;nbsp;"\d+" which are placed in the first capture buffer (the&amp;nbsp;"()"&amp;nbsp;around), a blank, a string which can be anything (".+", in the second capture buffer), a blank, some digits in&amp;nbsp;the third capture buffer, and finally some whithespace "\s*" and end of string "$". You then use PRXPOSN to get at the capture buffers.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2018 11:38:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PUT-INPUT-AND-SCAN/m-p/427975#M105604</guid>
      <dc:creator>s_lassen</dc:creator>
      <dc:date>2018-01-16T11:38:27Z</dc:date>
    </item>
    <item>
      <title>Re: PUT,INPUT AND SCAN</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PUT-INPUT-AND-SCAN/m-p/427979#M105607</link>
      <description>&lt;P&gt;I like this offering, one thing I would add is once you have pr_id and pr_qty, you could drop that from the first variable and avoid the longer code:&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt; want&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token keyword"&gt;  set&lt;/SPAN&gt; m&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
  pr_id&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;scan&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;info&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt; &lt;SPAN class="token number"&gt;1&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
  pr_qty&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;scan&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;info&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt; &lt;SPAN class="token number"&gt;-1&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;BR /&gt;&lt;/SPAN&gt;  pr_name&lt;SPAN class="token operator"&gt;=tranwrd(tranwrd(info,pr_id,""),pr_qty,"");&lt;/SPAN&gt;
&lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&amp;nbsp;&amp;nbsp;&lt;/PRE&gt;
&lt;P&gt;Just an option.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2018 11:51:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PUT-INPUT-AND-SCAN/m-p/427979#M105607</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-01-16T11:51:38Z</dc:date>
    </item>
    <item>
      <title>Re: PUT,INPUT AND SCAN</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PUT-INPUT-AND-SCAN/m-p/431210#M106613</link>
      <description>&lt;P&gt;i couldn't see any data in output. All i can see is table of pr_id,pr_qty,Info,pr_name.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jan 2018 11:08:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PUT-INPUT-AND-SCAN/m-p/431210#M106613</guid>
      <dc:creator>VISHNU239</dc:creator>
      <dc:date>2018-01-26T11:08:28Z</dc:date>
    </item>
    <item>
      <title>Re: PUT,INPUT AND SCAN</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PUT-INPUT-AND-SCAN/m-p/431212#M106614</link>
      <description>i am sorry i forgot to run the initial data m. even after running it i got all of them under info. but i want them seperately 101 102... under pr_id.pencils, parker.... under pr_name and the rest under pr_qty.</description>
      <pubDate>Fri, 26 Jan 2018 11:11:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PUT-INPUT-AND-SCAN/m-p/431212#M106614</guid>
      <dc:creator>VISHNU239</dc:creator>
      <dc:date>2018-01-26T11:11:31Z</dc:date>
    </item>
    <item>
      <title>Re: PUT,INPUT AND SCAN</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PUT-INPUT-AND-SCAN/m-p/431217#M106617</link>
      <description>&lt;P&gt;Show and example of what you mean.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jan 2018 11:36:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PUT-INPUT-AND-SCAN/m-p/431217#M106617</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-01-26T11:36:42Z</dc:date>
    </item>
    <item>
      <title>Re: PUT,INPUT AND SCAN</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PUT-INPUT-AND-SCAN/m-p/431242#M106629</link>
      <description />
      <pubDate>Fri, 26 Jan 2018 12:43:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PUT-INPUT-AND-SCAN/m-p/431242#M106629</guid>
      <dc:creator>VISHNU239</dc:creator>
      <dc:date>2018-01-26T12:43:58Z</dc:date>
    </item>
  </channel>
</rss>

