<?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 add extra record heading the dataset in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/add-extra-record-heading-the-dataset/m-p/87760#M25052</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys, I want to add this col0 to the top of the dataset "have", i.e&amp;nbsp; header this dataset,&lt;/P&gt;&lt;P&gt;but with using this proc sql code the record will be add to the bottom, any help to put it&lt;/P&gt;&lt;P&gt;as the header of the table rather than the bottom?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;*Add new record;&lt;/P&gt;&lt;P&gt;insert into have&lt;/P&gt;&lt;P&gt;set col0='Race'&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;V&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 20 Jun 2012 12:56:14 GMT</pubDate>
    <dc:creator>michtka</dc:creator>
    <dc:date>2012-06-20T12:56:14Z</dc:date>
    <item>
      <title>add extra record heading the dataset</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/add-extra-record-heading-the-dataset/m-p/87760#M25052</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys, I want to add this col0 to the top of the dataset "have", i.e&amp;nbsp; header this dataset,&lt;/P&gt;&lt;P&gt;but with using this proc sql code the record will be add to the bottom, any help to put it&lt;/P&gt;&lt;P&gt;as the header of the table rather than the bottom?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;*Add new record;&lt;/P&gt;&lt;P&gt;insert into have&lt;/P&gt;&lt;P&gt;set col0='Race'&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;V&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jun 2012 12:56:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/add-extra-record-heading-the-dataset/m-p/87760#M25052</guid>
      <dc:creator>michtka</dc:creator>
      <dc:date>2012-06-20T12:56:14Z</dc:date>
    </item>
    <item>
      <title>Re: add extra record heading the dataset</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/add-extra-record-heading-the-dataset/m-p/87761#M25053</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why do you want it on the top?&lt;/P&gt;&lt;P&gt;resorting the table can help. If you always want the newest at the top, add a load time column, and sort it by descending.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jun 2012 13:46:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/add-extra-record-heading-the-dataset/m-p/87761#M25053</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2012-06-20T13:46:07Z</dc:date>
    </item>
    <item>
      <title>Re: add extra record heading the dataset</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/add-extra-record-heading-the-dataset/m-p/87762#M25054</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SQL isn't necessarily the right tool to solve every problem.&amp;nbsp; Here's another approach:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data header_record;&lt;/P&gt;&lt;P&gt;if 0 then set have;&amp;nbsp; /* define identical variable attributes */&lt;/P&gt;&lt;P&gt;col0 = 'Race';&lt;/P&gt;&lt;P&gt;output;&lt;/P&gt;&lt;P&gt;stop;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc append data=have base=header_record;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jun 2012 13:55:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/add-extra-record-heading-the-dataset/m-p/87762#M25054</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2012-06-20T13:55:43Z</dc:date>
    </item>
    <item>
      <title>Re: add extra record heading the dataset</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/add-extra-record-heading-the-dataset/m-p/87763#M25055</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I know, for this reason I ask.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A question, which difference show your code with this other one? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; data new0;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; length col0 $30;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; col0='Race';&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; data newhave;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set new0 have;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;V&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jun 2012 14:10:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/add-extra-record-heading-the-dataset/m-p/87763#M25055</guid>
      <dc:creator>michtka</dc:creator>
      <dc:date>2012-06-20T14:10:41Z</dc:date>
    </item>
    <item>
      <title>Re: add extra record heading the dataset</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/add-extra-record-heading-the-dataset/m-p/87764#M25056</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; sorry, this one...to compare with yours: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; data header_record;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; length col0 $30;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; col0='Race';&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; data have;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set header_record have;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;V&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jun 2012 14:14:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/add-extra-record-heading-the-dataset/m-p/87764#M25056</guid>
      <dc:creator>michtka</dc:creator>
      <dc:date>2012-06-20T14:14:05Z</dc:date>
    </item>
    <item>
      <title>Re: add extra record heading the dataset</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/add-extra-record-heading-the-dataset/m-p/87765#M25057</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;They all work (assuming $30 is the right length for col0).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC APPEND will run slightly faster than the DATA step version.&amp;nbsp; But that may not be an issue.&amp;nbsp; In fact it has the downside feature of less flexibility in naming the output data set. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your DATA step variations require prior knowledge of the proper length for COL0.&amp;nbsp; To get around that requirement, I used the more complex DATA step to create HEADER_RECORD.&amp;nbsp; Even if you stick with your most recent approach, I would still recommend using my version of the DATA step that creates HEADER_RECORD.&amp;nbsp; It eliminates the chance that you'll make a mistake when setting a length for COL0.&amp;nbsp; The best reason for using the LENGTH statement approach is if the length for COL0 in HAVE is too short and you wish to set a longer length.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jun 2012 14:27:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/add-extra-record-heading-the-dataset/m-p/87765#M25057</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2012-06-20T14:27:14Z</dc:date>
    </item>
    <item>
      <title>Re: add extra record heading the dataset</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/add-extra-record-heading-the-dataset/m-p/87766#M25058</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Completelly agree, thank you for the explanation, it is exactly I wanted to understand to avoid a possible truncation issue for not considering the right length for the col0 variable.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jun 2012 14:47:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/add-extra-record-heading-the-dataset/m-p/87766#M25058</guid>
      <dc:creator>michtka</dc:creator>
      <dc:date>2012-06-20T14:47:31Z</dc:date>
    </item>
    <item>
      <title>Re: add extra record heading the dataset</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/add-extra-record-heading-the-dataset/m-p/87767#M25059</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Or a SQL alternative approach .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;proc sql;
create table want as
 select 'Patrick' as Name length=20 from sashelp.class(obs=1)
&amp;nbsp; outer union corresponding
 select * from sashelp.class;
quit;


&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jun 2012 02:05:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/add-extra-record-heading-the-dataset/m-p/87767#M25059</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2012-06-21T02:05:01Z</dc:date>
    </item>
  </channel>
</rss>

