<?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: COPY  data set  from WORK library into permanent library in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/COPY-data-set-from-WORK-library-into-permanent-library/m-p/903375#M356960</link>
    <description>Copy throught data step you mean to this code?&lt;BR /&gt;DATA R_R.tbl1;&lt;BR /&gt;SET WORK.tbl1;&lt;BR /&gt;Run;</description>
    <pubDate>Wed, 15 Nov 2023 21:56:52 GMT</pubDate>
    <dc:creator>Ronein</dc:creator>
    <dc:date>2023-11-15T21:56:52Z</dc:date>
    <item>
      <title>COPY  data set  from WORK library into permanent library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/COPY-data-set-from-WORK-library-into-permanent-library/m-p/903352#M356955</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;Let's say that I want to Rename data set tbl1 (in work library) into tbl2 (in work library) then the code will be :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc datasets library=WORK;
change tbl1=tbl2 ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Let's say that I want to Rename data set tbl1 (in permanent library R_R) into tbl2 (in permanent library R_R) then the code will be :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc datasets library=R_R;
change tbl1=tbl2 ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;My question:&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Let's say that I want to COPY&lt;BR /&gt;data set tbl1 (in WORK library) into tbl1 (in permanent library R_R)&amp;nbsp; - what is the code to do it?&lt;/P&gt;
&lt;P&gt;Please note that the data set is very big(25 million rows and 20 columns)&lt;/P&gt;
&lt;P&gt;and running&amp;nbsp; the following code will be too heavy and not efficient&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA R_R.tbl1;
SET WORK.tbl1;
Run;
proc delete data=WORK.tbl1;Run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Nov 2023 21:22:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/COPY-data-set-from-WORK-library-into-permanent-library/m-p/903352#M356955</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2023-11-15T21:22:23Z</dc:date>
    </item>
    <item>
      <title>Re: COPY  data set  from WORK library into permanent library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/COPY-data-set-from-WORK-library-into-permanent-library/m-p/903374#M356959</link>
      <description>&lt;P&gt;Unless your WORK and the permanent library are on the same physical disk (and you use an operating system which allows multiple links), you have to copy the whole file, either through a DATA step or the FCOPY function.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Instead of copying from WORK to anywhere else, change the final step which creates the dataset so that it is created in the permanent library in the first place.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Nov 2023 21:51:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/COPY-data-set-from-WORK-library-into-permanent-library/m-p/903374#M356959</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-11-15T21:51:19Z</dc:date>
    </item>
    <item>
      <title>Re: COPY  data set  from WORK library into permanent library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/COPY-data-set-from-WORK-library-into-permanent-library/m-p/903375#M356960</link>
      <description>Copy throught data step you mean to this code?&lt;BR /&gt;DATA R_R.tbl1;&lt;BR /&gt;SET WORK.tbl1;&lt;BR /&gt;Run;</description>
      <pubDate>Wed, 15 Nov 2023 21:56:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/COPY-data-set-from-WORK-library-into-permanent-library/m-p/903375#M356960</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2023-11-15T21:56:52Z</dc:date>
    </item>
    <item>
      <title>Re: COPY  data set  from WORK library into permanent library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/COPY-data-set-from-WORK-library-into-permanent-library/m-p/903376#M356961</link>
      <description>&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/proc/p04y85z9f13uaan10s1k40ptx6gs.htm" target="_self"&gt;PROC COPY&lt;/A&gt; works better than a DATA step.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Nov 2023 21:58:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/COPY-data-set-from-WORK-library-into-permanent-library/m-p/903376#M356961</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-11-15T21:58:55Z</dc:date>
    </item>
    <item>
      <title>Re: COPY  data set  from WORK library into permanent library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/COPY-data-set-from-WORK-library-into-permanent-library/m-p/903377#M356962</link>
      <description>&lt;P&gt;Let's say that R_R library is in this path&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/usr/local/SAS/SASUsers/LabRet/Credit_Scoring_Users/R_R&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;What is the&amp;nbsp;&lt;SPAN&gt;FCOPY function code that is needed here?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Nov 2023 21:59:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/COPY-data-set-from-WORK-library-into-permanent-library/m-p/903377#M356962</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2023-11-15T21:59:03Z</dc:date>
    </item>
    <item>
      <title>Re: COPY  data set  from WORK library into permanent library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/COPY-data-set-from-WORK-library-into-permanent-library/m-p/903388#M356966</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc copy in=work out=r_r;

select tbl1;

run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Nov 2023 22:38:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/COPY-data-set-from-WORK-library-into-permanent-library/m-p/903388#M356966</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2023-11-15T22:38:22Z</dc:date>
    </item>
    <item>
      <title>Re: COPY  data set  from WORK library into permanent library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/COPY-data-set-from-WORK-library-into-permanent-library/m-p/903395#M356971</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
rc = filename("source",pathname("work")!!"/tbl1.sas7bdat",,"recfm=n");
rc = filename("target","/usr/local/SAS/SASUsers/LabRet/Credit_Scoring_Users/R_R/tbl1.sas7bdat",,"recfm=n");
rc = fcopy("source","target");
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you have XCMD enabled, you can use the UNIX system's cp or mv command; if mv finds that both locations are on the same physical filesystem, it will simply create a new directory entry and remove the old one, meaning the whole process will finish in next to no time.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Nov 2023 23:02:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/COPY-data-set-from-WORK-library-into-permanent-library/m-p/903395#M356971</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-11-15T23:02:03Z</dc:date>
    </item>
  </channel>
</rss>

