<?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 Need to read .log files from two different locations and create a single SAS dataset in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Need-to-read-log-files-from-two-different-locations-and-create-a/m-p/520173#M3966</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to read .log files from two different locations, or folders and create a single data to process the events listed in the .log file to a SAS data set&lt;/P&gt;&lt;P&gt;i am currently using the below code and i am not sure how to loop this and read the files into a SAS data set.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let pth = /workspace/xxxx/xxxx/sasdta/ABC/logs/t1; /*one of the locations where the files are stored */&lt;/P&gt;&lt;P&gt;filename flx pipe "ls &amp;amp;path";&lt;/P&gt;&lt;P&gt;data x1;&lt;/P&gt;&lt;P&gt;length name $255.;&lt;/P&gt;&lt;P&gt;infile pth;&lt;/P&gt;&lt;P&gt;input name $;&lt;/P&gt;&lt;P&gt;lst_wrd = input(scan(name,-1,'.'),yymmdd10.);&lt;/P&gt;&lt;P&gt;fpth = "&amp;amp;pth./"||name;&lt;/P&gt;&lt;P&gt;if lst_wrd = '.' or lst_wrd ge "stdte."d then&lt;/P&gt;&lt;P&gt;output;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*to get the relevant files*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;set x1;&lt;/P&gt;&lt;P&gt;call execute ("filename lrecds pipe 'more"||&lt;SPAN&gt;pth||" | grep com.sas.solutions.casemgmnt.util.AppSessionContext';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;data x2;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;length fnme $1000;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;infile lrecds lrecl = 1000 dlm = '7F'x missover truncover dsd;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;input fnme $;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;if find (fnme,'INFO') then output;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;proc append base = x3 data = x2;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;run;");&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Please suggest me on this .&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks...&lt;/SPAN&gt;&lt;/P&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;&lt;P&gt;&amp;nbsp;&lt;/P&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>Mon, 10 Dec 2018 22:00:13 GMT</pubDate>
    <dc:creator>Santt0sh</dc:creator>
    <dc:date>2018-12-10T22:00:13Z</dc:date>
    <item>
      <title>Need to read .log files from two different locations and create a single SAS dataset</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Need-to-read-log-files-from-two-different-locations-and-create-a/m-p/520173#M3966</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to read .log files from two different locations, or folders and create a single data to process the events listed in the .log file to a SAS data set&lt;/P&gt;&lt;P&gt;i am currently using the below code and i am not sure how to loop this and read the files into a SAS data set.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let pth = /workspace/xxxx/xxxx/sasdta/ABC/logs/t1; /*one of the locations where the files are stored */&lt;/P&gt;&lt;P&gt;filename flx pipe "ls &amp;amp;path";&lt;/P&gt;&lt;P&gt;data x1;&lt;/P&gt;&lt;P&gt;length name $255.;&lt;/P&gt;&lt;P&gt;infile pth;&lt;/P&gt;&lt;P&gt;input name $;&lt;/P&gt;&lt;P&gt;lst_wrd = input(scan(name,-1,'.'),yymmdd10.);&lt;/P&gt;&lt;P&gt;fpth = "&amp;amp;pth./"||name;&lt;/P&gt;&lt;P&gt;if lst_wrd = '.' or lst_wrd ge "stdte."d then&lt;/P&gt;&lt;P&gt;output;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*to get the relevant files*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;set x1;&lt;/P&gt;&lt;P&gt;call execute ("filename lrecds pipe 'more"||&lt;SPAN&gt;pth||" | grep com.sas.solutions.casemgmnt.util.AppSessionContext';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;data x2;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;length fnme $1000;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;infile lrecds lrecl = 1000 dlm = '7F'x missover truncover dsd;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;input fnme $;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;if find (fnme,'INFO') then output;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;proc append base = x3 data = x2;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;run;");&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Please suggest me on this .&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks...&lt;/SPAN&gt;&lt;/P&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;&lt;P&gt;&amp;nbsp;&lt;/P&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>Mon, 10 Dec 2018 22:00:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Need-to-read-log-files-from-two-different-locations-and-create-a/m-p/520173#M3966</guid>
      <dc:creator>Santt0sh</dc:creator>
      <dc:date>2018-12-10T22:00:13Z</dc:date>
    </item>
    <item>
      <title>Re: Need to read .log files from two different locations and create a single SAS dataset</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Need-to-read-log-files-from-two-different-locations-and-create-a/m-p/520174#M3967</link>
      <description>&lt;P&gt;Sorry i missed to mention, i also need to read files from another location,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Location 2 :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;%let pth1 = /workspace/xxxx/xxxx/sasdta/ABC/logs/t2; /*one of the locations where the files are stored */&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Dec 2018 22:02:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Need-to-read-log-files-from-two-different-locations-and-create-a/m-p/520174#M3967</guid>
      <dc:creator>Santt0sh</dc:creator>
      <dc:date>2018-12-10T22:02:06Z</dc:date>
    </item>
  </channel>
</rss>

