<?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: Leaving a space between two datasets in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Leaving-a-space-between-two-datasets/m-p/8514#M386</link>
    <description>Yennie&lt;BR /&gt;
&lt;BR /&gt;
A SAS table is not the same like an Excel spreadsheet. Adding empty rows would mean observations with all variables set to missings to the SAS table. This would influence all further calculations.&lt;BR /&gt;
&lt;BR /&gt;
What you need is one SAS table (dataset) with all the data from table A and table B.&lt;BR /&gt;
&lt;BR /&gt;
1. Use a datastep or PROC TRANSPOSE to bring dataset A into the structure of dataset B.&lt;BR /&gt;
2. Create a new dataset C by combining A and B (add a variable identifying where the data comes from).&lt;BR /&gt;
3. Use something like PROC REPORT to create the desired output (Proc Report allows you to add empty lines between by groups).&lt;BR /&gt;
&lt;BR /&gt;
HTH&lt;BR /&gt;
Patrick

Message was edited by: Patrick</description>
    <pubDate>Fri, 23 Apr 2010 23:22:49 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2010-04-23T23:22:49Z</dc:date>
    <item>
      <title>Leaving a space between two datasets</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Leaving-a-space-between-two-datasets/m-p/8512#M384</link>
      <description>Hi all, I basically have two datasets as described below. &lt;BR /&gt;
&lt;BR /&gt;
&lt;B&gt;Dataset A&lt;/B&gt;&lt;BR /&gt;
key	year	make	model	Bodystyle&lt;BR /&gt;
24586A	2010	HOL	COMMODORE	Sedan&lt;BR /&gt;
12692S	2010	BMW	135	Coupe&lt;BR /&gt;
25496B	2010	TOY	CAMRY	Sedan&lt;BR /&gt;
79632V	2010	VOK	GOLF	Hatchback&lt;BR /&gt;
78542C	2010	MAZ	3	Hatchback&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;B&gt;Dataset B&lt;/B&gt;&lt;BR /&gt;
make	model	bodystyle	guide_1	guide_2	guide_3	guide_4	guide_5&lt;BR /&gt;
BMW	135	Coupe	1	2	0	0	6&lt;BR /&gt;
BMW	X5	4WD	0	10	0	5	40&lt;BR /&gt;
TOY	CAMRY	Sedan	0	0	3	6	20&lt;BR /&gt;
TOY	RAV4	4WD	80	1	7	8	50&lt;BR /&gt;
&lt;BR /&gt;
I am indexing &lt;B&gt;Data A&lt;/B&gt; to &lt;B&gt;Data B&lt;/B&gt; by make model and bodystyle and naming the new dataset as &lt;B&gt;Dataset C&lt;/B&gt;. &lt;BR /&gt;
&lt;BR /&gt;
Basically I want to be able to manipulate how Dataset C will appear in a way that retaining all the results in Data A on the top bit of Dataset C. Then leave two rows blank then present the results that match in Datset B after the blank rows. &lt;BR /&gt;
&lt;BR /&gt;
I am not sure if this can be done in SAS. But this is an example that I'd been trying to obtain... as below -&lt;BR /&gt;
&lt;BR /&gt;
key	year	make	model	Bodystyle	guide_1	guide_2	guide_3	guide_4	guide_5&lt;BR /&gt;
24586A	2010	HOL	COMMODORE	Sedan					&lt;BR /&gt;
12692S	2010	BMW	135	Coupe					&lt;BR /&gt;
25496B	2010	TOY	CAMRY	Sedan					&lt;BR /&gt;
79632V	2010	VOK	GOLF	Hatchback					&lt;BR /&gt;
78542C	2010	MAZ	3	Hatchback			&lt;BR /&gt;
&lt;BR /&gt;
		&lt;BR /&gt;
key	Year	make	model	Bodystyle	guide_1	guide_2	guide_3	guide_4	guide_5&lt;BR /&gt;
KBI10B	2009	BMW	135	Coupe	1	2	0	0	6&lt;BR /&gt;
KCU10B	2008	BMW	136	Coupe	1	3	1	1	9&lt;BR /&gt;
KCT10B	2007	BMW	137	Coupe	2	2	5	5	10&lt;BR /&gt;
KDJ10C	2009	TOY	CAMRY	Sedan	0	0	3	6	20&lt;BR /&gt;
&lt;BR /&gt;
Hoping someone will be able to help me out on this one. Cheers.</description>
      <pubDate>Fri, 23 Apr 2010 01:36:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Leaving-a-space-between-two-datasets/m-p/8512#M384</guid>
      <dc:creator>Yennie</dc:creator>
      <dc:date>2010-04-23T01:36:25Z</dc:date>
    </item>
    <item>
      <title>Re: Leaving a space between two datasets</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Leaving-a-space-between-two-datasets/m-p/8513#M385</link>
      <description>Can you explain more about what you need?  &lt;BR /&gt;
&lt;BR /&gt;
My suggestion would be to produce a report (rather than a dataset) that first prints Dataset A using one PROC PRINT then prints Dataset C using a second PROC PRINT.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
If you really want a SAS Dataset with both, you could start here:&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
data set4;&lt;BR /&gt;
	do until (eof);&lt;BR /&gt;
		set set1 end=eof;&lt;BR /&gt;
		output;&lt;BR /&gt;
	end;&lt;BR /&gt;
	do until (eof2);&lt;BR /&gt;
		set set3 end=eof2;&lt;BR /&gt;
		output;&lt;BR /&gt;
	end;&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
The spaces can be added with a little more programming.</description>
      <pubDate>Fri, 23 Apr 2010 21:18:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Leaving-a-space-between-two-datasets/m-p/8513#M385</guid>
      <dc:creator>1162</dc:creator>
      <dc:date>2010-04-23T21:18:59Z</dc:date>
    </item>
    <item>
      <title>Re: Leaving a space between two datasets</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Leaving-a-space-between-two-datasets/m-p/8514#M386</link>
      <description>Yennie&lt;BR /&gt;
&lt;BR /&gt;
A SAS table is not the same like an Excel spreadsheet. Adding empty rows would mean observations with all variables set to missings to the SAS table. This would influence all further calculations.&lt;BR /&gt;
&lt;BR /&gt;
What you need is one SAS table (dataset) with all the data from table A and table B.&lt;BR /&gt;
&lt;BR /&gt;
1. Use a datastep or PROC TRANSPOSE to bring dataset A into the structure of dataset B.&lt;BR /&gt;
2. Create a new dataset C by combining A and B (add a variable identifying where the data comes from).&lt;BR /&gt;
3. Use something like PROC REPORT to create the desired output (Proc Report allows you to add empty lines between by groups).&lt;BR /&gt;
&lt;BR /&gt;
HTH&lt;BR /&gt;
Patrick

Message was edited by: Patrick</description>
      <pubDate>Fri, 23 Apr 2010 23:22:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Leaving-a-space-between-two-datasets/m-p/8514#M386</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2010-04-23T23:22:49Z</dc:date>
    </item>
  </channel>
</rss>

