<?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 permanent dataset after sampling in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Creating-permanent-dataset-after-sampling/m-p/607840#M17593</link>
    <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/301480"&gt;@aongkeko&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can define a libname at the beginning of your code to specify the location :&lt;/P&gt;
&lt;P&gt;eg.:&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname mylib "&amp;lt;physical path&amp;gt;";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and then mention this libname in your code in the proc surveyselect:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;out=mylib.final_sample&lt;/CODE&gt;&amp;nbsp;&amp;nbsp;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 27 Nov 2019 20:11:18 GMT</pubDate>
    <dc:creator>ed_sas_member</dc:creator>
    <dc:date>2019-11-27T20:11:18Z</dc:date>
    <item>
      <title>Creating permanent dataset after sampling</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Creating-permanent-dataset-after-sampling/m-p/607838#M17592</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am currently working on a school project and I am stuck in the step where I need to save in a permanent library my sampled data. I know how to create one using a libname, but you usually do that at the beginning, right? Is there a way to do it after sampling (because I only want to save my sampled data)?&amp;nbsp; Below is my sas code for your reference.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks, in advance, SAS community!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Art&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Filename F1 'C:\Users\among\OneDrive\Desktop\Study1_1.txt';&lt;BR /&gt;data study1;&lt;BR /&gt;infile F1;&lt;BR /&gt;infile F1 dsd dlm=',';&lt;BR /&gt;infile F1 missover;&lt;BR /&gt;input Patient_ID Age State $ Length_of_Stay Total_Charge;&lt;BR /&gt;run;&lt;BR /&gt;proc print data=study1;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Filename F2 'C:\Users\among\OneDrive\Desktop\Study2_2.txt';&lt;BR /&gt;data study2;&lt;BR /&gt;infile F2;&lt;BR /&gt;infile F2 dsd dlm=',';&lt;BR /&gt;infile F2 missover;&lt;BR /&gt;input Patient_ID Group $ Test_Score;&lt;BR /&gt;run;&lt;BR /&gt;proc print data=study2;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc sort data=study1;&lt;BR /&gt;by Patient_ID;&lt;BR /&gt;run;&lt;BR /&gt;proc sort data=study2;&lt;BR /&gt;by Patient_ID;&lt;BR /&gt;run;&lt;BR /&gt;data final;&lt;BR /&gt;merge study1 study2;&lt;BR /&gt;by Patient_ID;&lt;BR /&gt;run;&lt;BR /&gt;proc print data=final;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc surveyselect&lt;BR /&gt;data=final&lt;BR /&gt;method=srs&lt;BR /&gt;sampsize=1000&lt;BR /&gt;out=final_sample&lt;BR /&gt;;&lt;BR /&gt;run;&lt;BR /&gt;proc print data=final_sample;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;--stuck here-- &amp;lt;how to save my sampled data?&amp;gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2019 20:06:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Creating-permanent-dataset-after-sampling/m-p/607838#M17592</guid>
      <dc:creator>aongkeko</dc:creator>
      <dc:date>2019-11-27T20:06:29Z</dc:date>
    </item>
    <item>
      <title>Re: Creating permanent dataset after sampling</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Creating-permanent-dataset-after-sampling/m-p/607840#M17593</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/301480"&gt;@aongkeko&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can define a libname at the beginning of your code to specify the location :&lt;/P&gt;
&lt;P&gt;eg.:&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname mylib "&amp;lt;physical path&amp;gt;";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and then mention this libname in your code in the proc surveyselect:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;out=mylib.final_sample&lt;/CODE&gt;&amp;nbsp;&amp;nbsp;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2019 20:11:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Creating-permanent-dataset-after-sampling/m-p/607840#M17593</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2019-11-27T20:11:18Z</dc:date>
    </item>
    <item>
      <title>Re: Creating permanent dataset after sampling</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Creating-permanent-dataset-after-sampling/m-p/607844#M17594</link>
      <description>&lt;P&gt;It worked! Thanks very much!&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2019 20:19:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Creating-permanent-dataset-after-sampling/m-p/607844#M17594</guid>
      <dc:creator>aongkeko</dc:creator>
      <dc:date>2019-11-27T20:19:57Z</dc:date>
    </item>
    <item>
      <title>Re: Creating permanent dataset after sampling</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Creating-permanent-dataset-after-sampling/m-p/607845#M17595</link>
      <description>&lt;P&gt;You're welcome&amp;nbsp;&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;!&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2019 20:21:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Creating-permanent-dataset-after-sampling/m-p/607845#M17595</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2019-11-27T20:21:06Z</dc:date>
    </item>
  </channel>
</rss>

