<?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 How to copy the all datasets structure from one library to another new library through sas base code in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-copy-the-all-datasets-structure-from-one-library-to/m-p/384574#M24772</link>
    <description>&lt;P&gt;How to copy the all datasets structure from one library to another new library through sas base code&lt;/P&gt;</description>
    <pubDate>Tue, 01 Aug 2017 12:44:24 GMT</pubDate>
    <dc:creator>SKG</dc:creator>
    <dc:date>2017-08-01T12:44:24Z</dc:date>
    <item>
      <title>How to copy the all datasets structure from one library to another new library through sas base code</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-copy-the-all-datasets-structure-from-one-library-to/m-p/384574#M24772</link>
      <description>&lt;P&gt;How to copy the all datasets structure from one library to another new library through sas base code&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2017 12:44:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-copy-the-all-datasets-structure-from-one-library-to/m-p/384574#M24772</guid>
      <dc:creator>SKG</dc:creator>
      <dc:date>2017-08-01T12:44:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to copy the all datasets structure from one library to another new library through sas base</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-copy-the-all-datasets-structure-from-one-library-to/m-p/384582#M24773</link>
      <description>&lt;P&gt;In what sense? &amp;nbsp;You just want to copy everything from one library to another:&lt;/P&gt;
&lt;PRE&gt;proc copy in=inlib out=outlib;
run;

&lt;/PRE&gt;
&lt;P&gt;If you want to create empty versions then a bit more code, and it doesn't really make sense doing this at all:&lt;/P&gt;
&lt;PRE&gt;data _null_;
  set sashelp.vcolumn (where=(libname="INLIB"));
  by memname;
  if first.memname then do;
    call execute('proc sql; create table OUTLIB.'||strip(memname))||' (');
    call execute(strip(name)||ifc(type="char","CHAR("||strip(put(length,best.))||")","NUM"));
  end;
  else call execute(","||strip(name)||ifc(type="char","CHAR("||strip(put(length,best.))||")","NUM"));
  if last.memname then call execute(');quit;');
run;&lt;/PRE&gt;
&lt;P&gt;This will generate the code necessary to create each table. &amp;nbsp;Again, this is Not advised.&lt;/P&gt;
&lt;P&gt;You could also sql describe table to a text file and then include that.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2017 13:05:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-copy-the-all-datasets-structure-from-one-library-to/m-p/384582#M24773</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-08-01T13:05:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to copy the all datasets structure from one library to another new library through sas base</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-copy-the-all-datasets-structure-from-one-library-to/m-p/384588#M24776</link>
      <description>&lt;P&gt;Make a macro to go through one of the both following code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1) &amp;nbsp;&lt;/P&gt;
&lt;P&gt;data x.have;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;set y.have;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;stop;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2)&lt;/P&gt;
&lt;P&gt;proc sql;&lt;/P&gt;
&lt;P&gt;create table x.have like y.have;&lt;/P&gt;
&lt;P&gt;quit;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2017 13:14:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-copy-the-all-datasets-structure-from-one-library-to/m-p/384588#M24776</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-08-01T13:14:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to copy the all datasets structure from one library to another new library through sas base</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-copy-the-all-datasets-structure-from-one-library-to/m-p/384589#M24777</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname x v9 'c:\temp';

data _null_;
 set sashelp.vmember(keep=libname memname where=(libname='X'));
 call execute(catt('data work.',memname,';set x.',memname,';stop;run;'));
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 01 Aug 2017 13:18:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-copy-the-all-datasets-structure-from-one-library-to/m-p/384589#M24777</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-08-01T13:18:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to copy the all datasets structure from one library to another new library through sas base</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-copy-the-all-datasets-structure-from-one-library-to/m-p/384595#M24778</link>
      <description>&lt;P&gt;Yes, good point&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt;, avoids need to do each column processing. &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2017 13:25:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-copy-the-all-datasets-structure-from-one-library-to/m-p/384595#M24778</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-08-01T13:25:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to copy the all datasets structure from one library to another new library through sas base</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-copy-the-all-datasets-structure-from-one-library-to/m-p/384865#M24794</link>
      <description>To copy the full structure, create a macro that copies the tables usin PROC APPEND with obs=0 dataset option on the DATA= data set.&lt;BR /&gt;This way you will also be able to replicate structural components such as indexes and constraints.</description>
      <pubDate>Wed, 02 Aug 2017 07:20:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-copy-the-all-datasets-structure-from-one-library-to/m-p/384865#M24794</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2017-08-02T07:20:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to copy the all datasets structure from one library to another new library through sas base</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-copy-the-all-datasets-structure-from-one-library-to/m-p/385965#M24874</link>
      <description>&lt;P&gt;59 data _null_;&lt;BR /&gt;60 set sashelp.vcolumn (where=(libname="Maps"));&lt;BR /&gt;61 by memname;&lt;BR /&gt;62 if first.memname then do;&lt;BR /&gt;63 call execute('proc sql; create table work.'||strip(memname)||' (');&lt;BR /&gt;64 call&lt;BR /&gt;64 ! execute(strip(name)||ifc(type="char","CHAR("||strip(put(length,best.))||")","NUM"));&lt;BR /&gt;65 end;&lt;BR /&gt;66 else call&lt;BR /&gt;66 ! execute(","||strip(name)||ifc(type="char","CHAR("||strip(put(length,best.))||")","NUM"));&lt;BR /&gt;67 if last.memname then call execute(');quit;');&lt;BR /&gt;68 run;&lt;/P&gt;&lt;P&gt;NOTE: The map data sets in library MAPSGFK are based on the digital maps from GfK GeoMarketing&lt;BR /&gt;and are covered by their Copyright. For additional information, see&lt;BR /&gt;&lt;A href="http://support.sas.com/mapsonline/gfklicense" target="_blank"&gt;http://support.sas.com/mapsonline/gfklicense&lt;/A&gt;.&lt;BR /&gt;NOTE: There were 0 observations read from the data set SASHELP.VCOLUMN.&lt;BR /&gt;WHERE libname='Maps';&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 12.31 seconds&lt;BR /&gt;cpu time 1.10 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not getting any observations from this code.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Aug 2017 10:30:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-copy-the-all-datasets-structure-from-one-library-to/m-p/385965#M24874</guid>
      <dc:creator>SKG</dc:creator>
      <dc:date>2017-08-07T10:30:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to copy the all datasets structure from one library to another new library through sas base</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-copy-the-all-datasets-structure-from-one-library-to/m-p/385966#M24875</link>
      <description>&lt;P&gt;69 data _null_;&lt;BR /&gt;70 set sashelp.vmember(keep=libname memname where=(libname='Maps'));&lt;BR /&gt;71 call execute(catt('data work.',memname,';set x.',memname,';stop;run;'));&lt;BR /&gt;72 run;&lt;/P&gt;&lt;P&gt;NOTE: There were 0 observations read from the data set SASHELP.VMEMBER.&lt;BR /&gt;WHERE libname='Maps';&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.12 seconds&lt;BR /&gt;cpu time 0.12 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not getting any observations from this code.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Aug 2017 10:36:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-copy-the-all-datasets-structure-from-one-library-to/m-p/385966#M24875</guid>
      <dc:creator>SKG</dc:creator>
      <dc:date>2017-08-07T10:36:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to copy the all datasets structure from one library to another new library through sas base</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-copy-the-all-datasets-structure-from-one-library-to/m-p/385971#M24877</link>
      <description>&lt;P&gt;And did you look at the view vcolumn in the library sashelp? &amp;nbsp;If you did you will see that libname variable is all upper case:&lt;/P&gt;
&lt;PRE&gt;set sashelp.vcolumn (where=(libname="MAPS"));&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Aug 2017 11:34:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-copy-the-all-datasets-structure-from-one-library-to/m-p/385971#M24877</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-08-07T11:34:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to copy the all datasets structure from one library to another new library through sas base</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-copy-the-all-datasets-structure-from-one-library-to/m-p/386044#M24880</link>
      <description>&lt;P&gt;Use PROC COPY to copy the datasets. Use option OBS=0 to prevent it from copying the data.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options obs=0;
proc copy inlib=IN outlib=OUT;
run;
options obs=max;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 07 Aug 2017 14:55:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-copy-the-all-datasets-structure-from-one-library-to/m-p/386044#M24880</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-08-07T14:55:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to copy the all datasets structure from one library to another new library through sas base</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-copy-the-all-datasets-structure-from-one-library-to/m-p/386245#M24890</link>
      <description>&lt;P&gt;Library name should be upcase.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt; libname='MAPS'&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;also change&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;;set x.',memname&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;into&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;;set maps.',memname&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Aug 2017 13:10:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-copy-the-all-datasets-structure-from-one-library-to/m-p/386245#M24890</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-08-08T13:10:39Z</dc:date>
    </item>
  </channel>
</rss>

