<?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: creating data set in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/creating-data-set/m-p/40904#M8385</link>
    <description>Hi Linus,&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Thank u very much, This is what i am looking for.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Thanks&lt;BR /&gt;
Slone</description>
    <pubDate>Thu, 04 Jun 2009 11:16:27 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2009-06-04T11:16:27Z</dc:date>
    <item>
      <title>creating data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/creating-data-set/m-p/40900#M8381</link>
      <description>Hi ,&lt;BR /&gt;
&lt;BR /&gt;
Any one can help me to resolve this issue. i want to create new variables for same value  in A variable.&lt;BR /&gt;
&lt;BR /&gt;
DATA SMP;&lt;BR /&gt;
INPUT A  B C;&lt;BR /&gt;
DATALINES;&lt;BR /&gt;
1 20 30      &lt;BR /&gt;
1 32 40&lt;BR /&gt;
1 45 60&lt;BR /&gt;
2 28 40&lt;BR /&gt;
2 30 40&lt;BR /&gt;
;&lt;BR /&gt;
i have tried in the following way but i dint get the result dataset&lt;BR /&gt;
DATA SMP1;&lt;BR /&gt;
ARRAY S(3) A1 A2 A3;&lt;BR /&gt;
ARRAY SB(3) B1 B2 B3;&lt;BR /&gt;
ARRAY SC(3) C1 C2 C3;&lt;BR /&gt;
SET SMP;&lt;BR /&gt;
BY A;&lt;BR /&gt;
IF FIRST.A THEN  DO I=1 TO 3;&lt;BR /&gt;
S(I)=A;&lt;BR /&gt;
SB(I)=B;&lt;BR /&gt;
SC(I)=C;&lt;BR /&gt;
END;&lt;BR /&gt;
RUN;&lt;BR /&gt;
&lt;BR /&gt;
out put is:&lt;BR /&gt;
&lt;BR /&gt;
OUTPUT;&lt;BR /&gt;
A  B   C     A1  B1 C1  A2 B2 C2&lt;BR /&gt;
1  20  30   1   32  40   1 45  60&lt;BR /&gt;
2  28  40   2  30   40    .  .   .&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Thanks in advance for response&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Thanks &lt;BR /&gt;
Slone</description>
      <pubDate>Thu, 04 Jun 2009 05:32:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/creating-data-set/m-p/40900#M8381</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-06-04T05:32:26Z</dc:date>
    </item>
    <item>
      <title>Re: creating data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/creating-data-set/m-p/40901#M8382</link>
      <description>This seems like a transpose to me.&lt;BR /&gt;
Have a look at PROC TRANSPOSE.&lt;BR /&gt;
If you want to do it in a data step, you might want to use RETAIN and explicit OUTPUT techniques instead.&lt;BR /&gt;
&lt;BR /&gt;
/Linus</description>
      <pubDate>Thu, 04 Jun 2009 07:36:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/creating-data-set/m-p/40901#M8382</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2009-06-04T07:36:50Z</dc:date>
    </item>
    <item>
      <title>Re: creating data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/creating-data-set/m-p/40902#M8383</link>
      <description>Hi Linus,&lt;BR /&gt;
&lt;BR /&gt;
Thank's for response,&lt;BR /&gt;
 i can create this by using Transpose and then merge these individual datasets , but is there any possibility, like hold that paritcular observation and check across the same group observations in a single data step.</description>
      <pubDate>Thu, 04 Jun 2009 08:58:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/creating-data-set/m-p/40902#M8383</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-06-04T08:58:26Z</dc:date>
    </item>
    <item>
      <title>Re: creating data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/creating-data-set/m-p/40903#M8384</link>
      <description>I am absolutely no array king, but here's a suggestion. I didn't bother to include A1-A3, since I couldn't understand what use you have for them, since A is the key...?&lt;BR /&gt;
&lt;BR /&gt;
DATA SMP1;&lt;BR /&gt;
	SET SMP;&lt;BR /&gt;
	array bb(3) b1-b3;&lt;BR /&gt;
	array cc(3) c1-c3;&lt;BR /&gt;
	retain b1 b2 b3 c1 c2 c3 n;&lt;BR /&gt;
	BY A;&lt;BR /&gt;
	if first.a then do;&lt;BR /&gt;
		n = 1;&lt;BR /&gt;
	   do i=1 to dim(bb);&lt;BR /&gt;
			bb(i) = .;&lt;BR /&gt;
			cc(i) = .;&lt;BR /&gt;
		end;		&lt;BR /&gt;
	end;	&lt;BR /&gt;
	bb(n) = b;&lt;BR /&gt;
	cc(n) = c;&lt;BR /&gt;
	put _all_;&lt;BR /&gt;
	IF LAST.A THEN output;&lt;BR /&gt;
	n+1;&lt;BR /&gt;
RUN;</description>
      <pubDate>Thu, 04 Jun 2009 10:29:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/creating-data-set/m-p/40903#M8384</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2009-06-04T10:29:47Z</dc:date>
    </item>
    <item>
      <title>Re: creating data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/creating-data-set/m-p/40904#M8385</link>
      <description>Hi Linus,&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Thank u very much, This is what i am looking for.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Thanks&lt;BR /&gt;
Slone</description>
      <pubDate>Thu, 04 Jun 2009 11:16:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/creating-data-set/m-p/40904#M8385</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-06-04T11:16:27Z</dc:date>
    </item>
  </channel>
</rss>

