<?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 Create a variable with count of obs in all files in a folder in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Create-a-variable-with-count-of-obs-in-all-files-in-a-folder/m-p/698937#M213795</link>
    <description>&lt;P&gt;I am using the following code to create a dataset of the file names for all SAS datasets within a specified folder (I then trim part of the filename in the second step).&amp;nbsp; I want to add a second field, one that includes the number of observations in each of the named datasets.&amp;nbsp; Thoughts?&amp;nbsp; Thanks in advance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
CREATE TABLE CULL AS
select catx('.',libname,memname) into :setnames separated by ' '
from dictionary.tables
where libname = 'RESULTS';
quit;

DATA Cull ;
SET CULL;
_TEMA001=tranwrd(_TEMA001,"RESULTS.TARGETS_","");
RUN;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sun, 15 Nov 2020 07:31:40 GMT</pubDate>
    <dc:creator>texasmfp</dc:creator>
    <dc:date>2020-11-15T07:31:40Z</dc:date>
    <item>
      <title>Create a variable with count of obs in all files in a folder</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-variable-with-count-of-obs-in-all-files-in-a-folder/m-p/698937#M213795</link>
      <description>&lt;P&gt;I am using the following code to create a dataset of the file names for all SAS datasets within a specified folder (I then trim part of the filename in the second step).&amp;nbsp; I want to add a second field, one that includes the number of observations in each of the named datasets.&amp;nbsp; Thoughts?&amp;nbsp; Thanks in advance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
CREATE TABLE CULL AS
select catx('.',libname,memname) into :setnames separated by ' '
from dictionary.tables
where libname = 'RESULTS';
quit;

DATA Cull ;
SET CULL;
_TEMA001=tranwrd(_TEMA001,"RESULTS.TARGETS_","");
RUN;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 15 Nov 2020 07:31:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-variable-with-count-of-obs-in-all-files-in-a-folder/m-p/698937#M213795</guid>
      <dc:creator>texasmfp</dc:creator>
      <dc:date>2020-11-15T07:31:40Z</dc:date>
    </item>
    <item>
      <title>Re: Create a variable with count of obs in all files in a folder</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-variable-with-count-of-obs-in-all-files-in-a-folder/m-p/698938#M213796</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
CREATE TABLE CULL AS
select catx('.',libname,memname) ,nobs into :setnames,:nobs separated by ' '
from dictionary.tables
where libname = 'RESULTS';
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Like this?&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/?cdcId=vdmmlcdc&amp;amp;cdcVersion=1.0&amp;amp;docsetId=mcrolref&amp;amp;docsetTarget=n1y2jszlvs4hugn14nooftfrxhp3.htm&amp;amp;locale=en" target="_blank"&gt;https://documentation.sas.com/?cdcId=vdmmlcdc&amp;amp;cdcVersion=1.0&amp;amp;docsetId=mcrolref&amp;amp;docsetTarget=n1y2jszlvs4hugn14nooftfrxhp3.htm&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Nov 2020 08:16:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-variable-with-count-of-obs-in-all-files-in-a-folder/m-p/698938#M213796</guid>
      <dc:creator>hhinohar</dc:creator>
      <dc:date>2020-11-15T08:16:05Z</dc:date>
    </item>
  </channel>
</rss>

