<?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: Wildcard Infile Statement: use Logfile NOTE information of &amp;lt;Number of records&amp;gt; in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Wildcard-Infile-Statement-use-Logfile-NOTE-information-of-lt/m-p/803751#M316489</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;great, it works fine!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15410"&gt;@data_null__&lt;/a&gt;&amp;nbsp;: thank you, too, for enlightening me about "EOV" option!&lt;/P&gt;</description>
    <pubDate>Thu, 24 Mar 2022 08:52:16 GMT</pubDate>
    <dc:creator>FK1</dc:creator>
    <dc:date>2022-03-24T08:52:16Z</dc:date>
    <item>
      <title>Wildcard Infile Statement: use Logfile NOTE information of &lt;Number of records&gt;</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Wildcard-Infile-Statement-use-Logfile-NOTE-information-of-lt/m-p/803565#M316411</link>
      <description>&lt;P&gt;Hello Everyone,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am using a wildcard infile statement to read LSF-Logs into SAS:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename _Harchiv "/path/to/lsf_history_files/pm/work/history/archiv/history.log.*";

data work.Historyfiles_archiv;
  length      historyfile $100.	 ;
/* store the name of the current infile */  
infile _Harchiv filename=historyfile truncover  dlm='20'x; 
input rawdata $1000.   ;
name_history_file = historyfile;
Einlesezeitpunkt_history_file = datetime();
format Einlesezeitpunkt_history_file datetime25.6;
run;

filename _Harchiv clear;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This works perfectly, as the SAS Logs confirms:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;NOTE: The infile _HARCHIV is:
      Filename=/path/to/lsf_history_files/pm/work/history/archiv/history.log.1000,
      File List=/path/to/lsf_history_files/pm/work/history/archiv/history.log.*,
      Owner Name=sas,Group Name=sas,
      Access Permission=-rw-r--r--,
      Last Modified=18. November 2021 20.59 Uhr,
      File Size (bytes)=500147

NOTE: The infile _HARCHIV is:
      Filename=/path/to/lsf_history_files/pm/work/history/archiv/history.log.1001,
      File List=/path/to/lsf_history_files/pm/work/history/archiv/history.log.*,
      Owner Name=sas,Group Name=sas,
      Access Permission=-rw-r--r--,
      Last Modified=18. November 2021 22.26 Uhr,
      File Size (bytes)=500674

NOTE: The infile _HARCHIV is:
      Filename=/path/to/lsf_history_files/pm/work/history/archiv/history.log.1002,
      File List=/path/to/lsf_history_files/pm/work/history/archiv/history.log.*,
      Owner Name=sas,Group Name=sas,
      Access Permission=-rw-r--r--,
      Last Modified=18. November 2021 23.56 Uhr,
      File Size (bytes)=500385&lt;BR /&gt;&lt;BR /&gt;...&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Also, there are further notes, about the number of records (i.e. lines of the LSF logfile) that have been read in:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;NOTE: 1644 records were read from the infile _HARCHIV.
The minimum record length was 77.
The maximum record length was 948.
NOTE: 1627 records were read from the infile _HARCHIV.
The minimum record length was 81.
The maximum record length was 948.
NOTE: 1631 records were read from the infile _HARCHIV.
The minimum record length was 81.
The maximum record length was 948.&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My question is:&lt;/P&gt;
&lt;P&gt;As SAS obviously derives the number of lines in the LSF Logfile(s), which have been read in, in order to put it in the SAS Log as a NOTE, is there a way, I am able to generate a variable in the SAS dataset that holds the read in infile information, including a variable that tells me, how many lines have been read in using the above mentioned number?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I know in a "regular" data step I can use "nobs=" option in the set statement, or use the internal Variable "_N_".&lt;/P&gt;
&lt;P&gt;Since I am using a wildcard infile statement, is there an infile statement option that "gives" me the number of read in lines? The only other way I know of, would be to use a dynamic pipe...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help would be highly appreciated.&lt;/P&gt;
&lt;P&gt;FK1&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2022 14:06:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Wildcard-Infile-Statement-use-Logfile-NOTE-information-of-lt/m-p/803565#M316411</guid>
      <dc:creator>FK1</dc:creator>
      <dc:date>2022-03-23T14:06:45Z</dc:date>
    </item>
    <item>
      <title>Re: Wildcard Infile Statement: use Logfile NOTE information of &lt;Number of records&gt;</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Wildcard-Infile-Statement-use-Logfile-NOTE-information-of-lt/m-p/803573#M316415</link>
      <description>&lt;P&gt;You can use the INFILE statement option EOV= to detect when the file changes.&amp;nbsp; With that you can count the number of records read.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2022 14:11:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Wildcard-Infile-Statement-use-Logfile-NOTE-information-of-lt/m-p/803573#M316415</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2022-03-23T14:11:12Z</dc:date>
    </item>
    <item>
      <title>Re: Wildcard Infile Statement: use Logfile NOTE information of &lt;Number of records&gt;</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Wildcard-Infile-Statement-use-Logfile-NOTE-information-of-lt/m-p/803581#M316421</link>
      <description>&lt;P&gt;Just check when the variable populated by FILENAME= option changes.&amp;nbsp; I find that is easier to use than the EOV= option variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data work.Historyfiles_archiv;
  length historyfile $100;
  infile "/path/to/lsf_history_files/pm/work/history/archiv/history.log.*"
    filename=historyfile truncover 
  ; 
  input rawdata $1000.;
  name_history_file = historyfile;
  if historyfile ne lag(historyfile) then lineno=0;
  lineno+1;
  Einlesezeitpunkt_history_file = datetime();
  format Einlesezeitpunkt_history_file datetime25.6;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 23 Mar 2022 15:05:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Wildcard-Infile-Statement-use-Logfile-NOTE-information-of-lt/m-p/803581#M316421</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-03-23T15:05:03Z</dc:date>
    </item>
    <item>
      <title>Re: Wildcard Infile Statement: use Logfile NOTE information of &lt;Number of records&gt;</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Wildcard-Infile-Statement-use-Logfile-NOTE-information-of-lt/m-p/803751#M316489</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;great, it works fine!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15410"&gt;@data_null__&lt;/a&gt;&amp;nbsp;: thank you, too, for enlightening me about "EOV" option!&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2022 08:52:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Wildcard-Infile-Statement-use-Logfile-NOTE-information-of-lt/m-p/803751#M316489</guid>
      <dc:creator>FK1</dc:creator>
      <dc:date>2022-03-24T08:52:16Z</dc:date>
    </item>
  </channel>
</rss>

