<?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: Create dataset uing scan function in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Create-dataset-uing-scan-function/m-p/18713#M2832</link>
    <description>Hema&lt;BR /&gt;
&lt;BR /&gt;
You only learn it by solving it yourself - or at least invest some time trying to find out. &lt;BR /&gt;
You'll find everything in the Online Doc and there are normally also examples.&lt;BR /&gt;
&lt;BR /&gt;
But let's assume you waited too long before starting with work....&lt;BR /&gt;
&lt;BR /&gt;
data have;&lt;BR /&gt;
  var="something|to|be|written|here.";&lt;BR /&gt;
run;&lt;BR /&gt;
data want;&lt;BR /&gt;
  set have;&lt;BR /&gt;
  length newvar $ 10;&lt;BR /&gt;
  keep newvar;&lt;BR /&gt;
  do i=1 to length(var) while(scan(var,i,'|') ne '' );&lt;BR /&gt;
    newvar=scan(var,i,'|');&lt;BR /&gt;
    output;&lt;BR /&gt;
  end;&lt;BR /&gt;
run;&lt;BR /&gt;
proc print data=want;&lt;BR /&gt;
run;</description>
    <pubDate>Wed, 18 Nov 2009 10:54:11 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2009-11-18T10:54:11Z</dc:date>
    <item>
      <title>Create dataset uing scan function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-dataset-uing-scan-function/m-p/18712#M2831</link>
      <description>Hi All,&lt;BR /&gt;
I have one dataset (data1) with single observation say: something|to|be|written|here.&lt;BR /&gt;
&lt;BR /&gt;
I have to create other dataset(data2) from above dataset(data1) with below observations:&lt;BR /&gt;
something&lt;BR /&gt;
to&lt;BR /&gt;
be &lt;BR /&gt;
written&lt;BR /&gt;
here&lt;BR /&gt;
&lt;BR /&gt;
I have to do this using scan function only.&lt;BR /&gt;
&lt;BR /&gt;
Please Help!!!&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
Hema Tandon</description>
      <pubDate>Wed, 18 Nov 2009 07:43:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-dataset-uing-scan-function/m-p/18712#M2831</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-11-18T07:43:58Z</dc:date>
    </item>
    <item>
      <title>Re: Create dataset uing scan function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-dataset-uing-scan-function/m-p/18713#M2832</link>
      <description>Hema&lt;BR /&gt;
&lt;BR /&gt;
You only learn it by solving it yourself - or at least invest some time trying to find out. &lt;BR /&gt;
You'll find everything in the Online Doc and there are normally also examples.&lt;BR /&gt;
&lt;BR /&gt;
But let's assume you waited too long before starting with work....&lt;BR /&gt;
&lt;BR /&gt;
data have;&lt;BR /&gt;
  var="something|to|be|written|here.";&lt;BR /&gt;
run;&lt;BR /&gt;
data want;&lt;BR /&gt;
  set have;&lt;BR /&gt;
  length newvar $ 10;&lt;BR /&gt;
  keep newvar;&lt;BR /&gt;
  do i=1 to length(var) while(scan(var,i,'|') ne '' );&lt;BR /&gt;
    newvar=scan(var,i,'|');&lt;BR /&gt;
    output;&lt;BR /&gt;
  end;&lt;BR /&gt;
run;&lt;BR /&gt;
proc print data=want;&lt;BR /&gt;
run;</description>
      <pubDate>Wed, 18 Nov 2009 10:54:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-dataset-uing-scan-function/m-p/18713#M2832</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2009-11-18T10:54:11Z</dc:date>
    </item>
    <item>
      <title>Re: Create dataset uing scan function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-dataset-uing-scan-function/m-p/18714#M2833</link>
      <description>Thanks Patrick,&lt;BR /&gt;
&lt;BR /&gt;
I was missing output statement in the code I wrote &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
I am new to SAS,trying to practice it but not able to find much exercises for trying writing new codes.&lt;BR /&gt;
&lt;BR /&gt;
Regards,&lt;BR /&gt;
Hema Tandon</description>
      <pubDate>Wed, 18 Nov 2009 11:56:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-dataset-uing-scan-function/m-p/18714#M2833</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-11-18T11:56:48Z</dc:date>
    </item>
    <item>
      <title>Re: Create dataset uing scan function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-dataset-uing-scan-function/m-p/18715#M2834</link>
      <description>Suggested Internet search:&lt;BR /&gt;
&lt;BR /&gt;
sas programming exercises&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Also, you will find code samples here:&lt;BR /&gt;
&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/onlinedoc/code.samples.html" target="_blank"&gt;http://support.sas.com/documentation/onlinedoc/code.samples.html&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Wed, 18 Nov 2009 14:22:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-dataset-uing-scan-function/m-p/18715#M2834</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-11-18T14:22:50Z</dc:date>
    </item>
  </channel>
</rss>

