<?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: how to create a diffetent dataset from one dataset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-create-a-diffetent-dataset-from-one-dataset/m-p/21357#M3425</link>
    <description>Can't really understand what data you have and what you need to do with them.&lt;BR /&gt;
You have one file with just names of other files and all those other files? What do you need to get?</description>
    <pubDate>Thu, 03 Mar 2011 12:44:02 GMT</pubDate>
    <dc:creator>ieva</dc:creator>
    <dc:date>2011-03-03T12:44:02Z</dc:date>
    <item>
      <title>how to create a diffetent dataset from one dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-create-a-diffetent-dataset-from-one-dataset/m-p/21356#M3424</link>
      <description>I  have a data set Filename  having following contentent&lt;BR /&gt;
&lt;BR /&gt;
name &lt;BR /&gt;
A&lt;BR /&gt;
AA&lt;BR /&gt;
B&lt;BR /&gt;
BB&lt;BR /&gt;
C&lt;BR /&gt;
CC&lt;BR /&gt;
D&lt;BR /&gt;
DD&lt;BR /&gt;
&lt;BR /&gt;
Each recods of dataset filename has create a individul file which content is like&lt;BR /&gt;
&lt;BR /&gt;
A&lt;BR /&gt;
a S E&lt;BR /&gt;
b S E&lt;BR /&gt;
c S E&lt;BR /&gt;
&lt;BR /&gt;
AA&lt;BR /&gt;
&lt;BR /&gt;
aa S E &lt;BR /&gt;
aa S E &lt;BR /&gt;
BB S E&lt;BR /&gt;
&lt;BR /&gt;
so on&lt;BR /&gt;
&lt;BR /&gt;
I want to create each file  have different data set &lt;BR /&gt;
&lt;BR /&gt;
Kindly help me</description>
      <pubDate>Thu, 03 Mar 2011 11:22:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-create-a-diffetent-dataset-from-one-dataset/m-p/21356#M3424</guid>
      <dc:creator>arpit</dc:creator>
      <dc:date>2011-03-03T11:22:57Z</dc:date>
    </item>
    <item>
      <title>Re: how to create a diffetent dataset from one dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-create-a-diffetent-dataset-from-one-dataset/m-p/21357#M3425</link>
      <description>Can't really understand what data you have and what you need to do with them.&lt;BR /&gt;
You have one file with just names of other files and all those other files? What do you need to get?</description>
      <pubDate>Thu, 03 Mar 2011 12:44:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-create-a-diffetent-dataset-from-one-dataset/m-p/21357#M3425</guid>
      <dc:creator>ieva</dc:creator>
      <dc:date>2011-03-03T12:44:02Z</dc:date>
    </item>
    <item>
      <title>Re: how to create a diffetent dataset from one dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-create-a-diffetent-dataset-from-one-dataset/m-p/21358#M3426</link>
      <description>Hello Arpit,&lt;BR /&gt;
&lt;BR /&gt;
This is solution. I am not sure that I understood your intentions. If you have more letters involved A, B, C, D, E, ... etc. then the program have to be converted into a macro. First try to use this:&lt;BR /&gt;
[pre]&lt;BR /&gt;
data i;&lt;BR /&gt;
input name $;&lt;BR /&gt;
datalines; &lt;BR /&gt;
A&lt;BR /&gt;
AA&lt;BR /&gt;
B&lt;BR /&gt;
BB&lt;BR /&gt;
C&lt;BR /&gt;
CC&lt;BR /&gt;
D&lt;BR /&gt;
DD&lt;BR /&gt;
run;&lt;BR /&gt;
data a aa b bb c cc d dd;&lt;BR /&gt;
  set i;&lt;BR /&gt;
  S="S";&lt;BR /&gt;
  E="E";&lt;BR /&gt;
  if      SUBSTR(name,1,2) = "A"  then output a;&lt;BR /&gt;
  else if SUBSTR(name,1,2) = "AA" then output aa;&lt;BR /&gt;
  else if SUBSTR(name,1,2) = "B"  then output b;&lt;BR /&gt;
  else if SUBSTR(name,1,2) = "BB" then output bb;&lt;BR /&gt;
  else if SUBSTR(name,1,2) = "C"  then output c;&lt;BR /&gt;
  else if SUBSTR(name,1,2) = "CC" then output cc;&lt;BR /&gt;
  else if SUBSTR(name,1,2) = "D"  then output d;&lt;BR /&gt;
  else if SUBSTR(name,1,2) = "DD" then output dd;&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
Sincerely,&lt;BR /&gt;
SPR</description>
      <pubDate>Thu, 03 Mar 2011 16:25:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-create-a-diffetent-dataset-from-one-dataset/m-p/21358#M3426</guid>
      <dc:creator>SPR</dc:creator>
      <dc:date>2011-03-03T16:25:12Z</dc:date>
    </item>
    <item>
      <title>Re: how to create a diffetent dataset from one dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-create-a-diffetent-dataset-from-one-dataset/m-p/21359#M3427</link>
      <description>Sigh.&lt;BR /&gt;
If you search support.sas.com by yourself ,you will find some example.&lt;BR /&gt;
I post some exampl code I wrote before.You can refer to  it.&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
%let subdir=D:\sasdata\temp\;&lt;BR /&gt;
data filename;&lt;BR /&gt;
   input filename  : $100.;&lt;BR /&gt;
cards;&lt;BR /&gt;
A.csv&lt;BR /&gt;
AA.csv&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data new;&lt;BR /&gt;
 set filename end=last;&lt;BR /&gt;
 filename=cats("&amp;amp;subdir",filename);&lt;BR /&gt;
 call symputx(cats('path',_n_),filename);&lt;BR /&gt;
 call symputx(cats('dsn',_n_),scan(scan(filename,5,'\'),1,'.'));&lt;BR /&gt;
 if last then call symputx('nobs',_n_);&lt;BR /&gt;
run;&lt;BR /&gt;
%put _user_;&lt;BR /&gt;
&lt;BR /&gt;
%macro import;&lt;BR /&gt;
%do i=1 %to &amp;amp;nobs;&lt;BR /&gt;
&lt;BR /&gt;
data WORK.&amp;amp;&amp;amp;dsn&amp;amp;i;                                       ;&lt;BR /&gt;
      %let _EFIERR_ = 0; /* set the ERROR detection macro variable */&lt;BR /&gt;
      infile "&amp;amp;&amp;amp;path&amp;amp;i" delimiter = ',' MISSOVER DSD lrecl=32767 firstobs=2 ;&lt;BR /&gt;
         informat VAR1 best32. ;&lt;BR /&gt;
         informat VAR2 $30. ;&lt;BR /&gt;
         informat VAR3 comma30. ;&lt;BR /&gt;
         informat VAR4 comma30.;&lt;BR /&gt;
         informat VAR5 comma30.;&lt;BR /&gt;
         informat VAR6 comma30.;&lt;BR /&gt;
         informat VAR7 comma30.;&lt;BR /&gt;
         informat VAR8 comma30.;&lt;BR /&gt;
         informat VAR9 best12.;&lt;BR /&gt;
         format VAR1 best12. ;&lt;BR /&gt;
         format VAR2 $30. ;&lt;BR /&gt;
         format VAR3 best32.2 ;&lt;BR /&gt;
         format VAR4 best32.2;&lt;BR /&gt;
         format VAR5 best32.2;&lt;BR /&gt;
         format VAR6 best32.2;&lt;BR /&gt;
         format VAR7 best32.2;&lt;BR /&gt;
         format VAR8 best32.2;&lt;BR /&gt;
         format VAR9 best12. ;&lt;BR /&gt;
      input&lt;BR /&gt;
                  VAR1&lt;BR /&gt;
                  VAR2 &lt;BR /&gt;
                  VAR3&lt;BR /&gt;
                  VAR4 &lt;BR /&gt;
                  VAR5&lt;BR /&gt;
                  VAR6&lt;BR /&gt;
                  VAR7&lt;BR /&gt;
                  VAR8 &lt;BR /&gt;
                  VAR9&lt;BR /&gt;
      ;&lt;BR /&gt;
    &lt;BR /&gt;
      if _ERROR_ then call symputx('_EFIERR_',1);  /* set ERROR detection macro variable */&lt;BR /&gt;
      run;&lt;BR /&gt;
%end;&lt;BR /&gt;
%mend import;&lt;BR /&gt;
&lt;BR /&gt;
%import&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ksharp</description>
      <pubDate>Fri, 04 Mar 2011 01:59:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-create-a-diffetent-dataset-from-one-dataset/m-p/21359#M3427</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-03-04T01:59:07Z</dc:date>
    </item>
  </channel>
</rss>

