<?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 Extract .sas and .log file in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Extract-sas-and-log-file/m-p/842479#M333131</link>
    <description>&lt;P&gt;Heping hands, I need few helps here. From below three records , I need to extract *.sas and .log file as for example , 1st record "G:\DATA\QDF\PGMS\05_Master.sas" and "G:\Data\QDF\PGMS\Log\05_Master_221011.log", same for other records.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please suggest.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;input @1 old_prog $150.;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;I,Job started. cmd=[D:\Progs\SASexec.pl --sysin G:\DATA\QDF\PGMS\05_Master.sas --log G:\Data\QDF\PGMS\Log\05_Master_221011.log&lt;/P&gt;&lt;P&gt;I,Job started. cmd=[D:\Progs\SASexec.pl&amp;nbsp;&amp;nbsp;--config en --sysin G:\Data\QMO\PGMS\General\Prepare_Technical_Gofiles.sas --option "-sysparm '${UACBATCHRUN}${FREQ} prod&amp;nbsp;&amp;nbsp;'" --log G:\Data\QMO\OUTPUT\Log\Prepare_Technical_Gofiles_20221011_000631.log ], pid=1748&lt;/P&gt;&lt;P&gt;I,Job started. cmd=[D:\Progs\SASexec.pl --sysin G:\SAS_GLOBALS\Global_Startup\MainProg_new.sas --config en --log G:\data\QZ3\OUTPUT\QZ3003\log\QZ3003_221011_001434.log --print G:\DATA\QZ3\OUTPUT\QZ3003\LOG\QZ3003_221011_001434.lst --option "-sysparm PQZ3&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 04 Nov 2022 11:34:30 GMT</pubDate>
    <dc:creator>kumarsandip975</dc:creator>
    <dc:date>2022-11-04T11:34:30Z</dc:date>
    <item>
      <title>Extract .sas and .log file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extract-sas-and-log-file/m-p/842479#M333131</link>
      <description>&lt;P&gt;Heping hands, I need few helps here. From below three records , I need to extract *.sas and .log file as for example , 1st record "G:\DATA\QDF\PGMS\05_Master.sas" and "G:\Data\QDF\PGMS\Log\05_Master_221011.log", same for other records.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please suggest.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;input @1 old_prog $150.;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;I,Job started. cmd=[D:\Progs\SASexec.pl --sysin G:\DATA\QDF\PGMS\05_Master.sas --log G:\Data\QDF\PGMS\Log\05_Master_221011.log&lt;/P&gt;&lt;P&gt;I,Job started. cmd=[D:\Progs\SASexec.pl&amp;nbsp;&amp;nbsp;--config en --sysin G:\Data\QMO\PGMS\General\Prepare_Technical_Gofiles.sas --option "-sysparm '${UACBATCHRUN}${FREQ} prod&amp;nbsp;&amp;nbsp;'" --log G:\Data\QMO\OUTPUT\Log\Prepare_Technical_Gofiles_20221011_000631.log ], pid=1748&lt;/P&gt;&lt;P&gt;I,Job started. cmd=[D:\Progs\SASexec.pl --sysin G:\SAS_GLOBALS\Global_Startup\MainProg_new.sas --config en --log G:\data\QZ3\OUTPUT\QZ3003\log\QZ3003_221011_001434.log --print G:\DATA\QZ3\OUTPUT\QZ3003\LOG\QZ3003_221011_001434.lst --option "-sysparm PQZ3&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Nov 2022 11:34:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extract-sas-and-log-file/m-p/842479#M333131</guid>
      <dc:creator>kumarsandip975</dc:creator>
      <dc:date>2022-11-04T11:34:30Z</dc:date>
    </item>
    <item>
      <title>Re: Extract .sas and .log file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extract-sas-and-log-file/m-p/842489#M333134</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
infile cards truncover;
input old_prog $500.;
datalines;
I,Job started. cmd=[D:\Progs\SASexec.pl --sysin G:\DATA\QDF\PGMS\05_Master.sas --log G:\Data\QDF\PGMS\Log\05_Master_221011.log
I,Job started. cmd=[D:\Progs\SASexec.pl  --config en --sysin G:\Data\QMO\PGMS\General\Prepare_Technical_Gofiles.sas --option "-sysparm '${UACBATCHRUN}${FREQ} prod  '" --log G:\Data\QMO\OUTPUT\Log\Prepare_Technical_Gofiles_20221011_000631.log ], pid=1748
I,Job started. cmd=[D:\Progs\SASexec.pl --sysin G:\SAS_GLOBALS\Global_Startup\MainProg_new.sas --config en --log G:\data\QZ3\OUTPUT\QZ3003\log\QZ3003_221011_001434.log --print G:\DATA\QZ3\OUTPUT\QZ3003\LOG\QZ3003_221011_001434.lst --option "-sysparm PQZ3
;


data want;
 set have;
 sas_file=scan(substr(old_prog,findw(old_prog,'--sysin')+7),1,'-],');
 sas_log=scan(substr(old_prog,findw(old_prog,'--log')+5),1,'-],');
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 04 Nov 2022 12:46:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extract-sas-and-log-file/m-p/842489#M333134</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2022-11-04T12:46:55Z</dc:date>
    </item>
    <item>
      <title>Re: Extract .sas and .log file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extract-sas-and-log-file/m-p/842498#M333137</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
   length sas log $32767;
   set have;
   sas=prxchange('s/.*\s(\w:.*?\.sas)\s.*/$1/',-1,old_prog);
   log=prxchange('s/.*\s(\w:.*?\.log)\s.*/$1/',-1,old_prog);
   if sas eq old_prog then sas='';
   if log eq old_prog then log='';
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 04 Nov 2022 13:29:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extract-sas-and-log-file/m-p/842498#M333137</guid>
      <dc:creator>Oligolas</dc:creator>
      <dc:date>2022-11-04T13:29:06Z</dc:date>
    </item>
    <item>
      <title>Re: Extract .sas and .log file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extract-sas-and-log-file/m-p/845044#M334078</link>
      <description>&lt;P&gt;Thanks Everyone, solution provided helped. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Nov 2022 06:26:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extract-sas-and-log-file/m-p/845044#M334078</guid>
      <dc:creator>kumarsandip975</dc:creator>
      <dc:date>2022-11-18T06:26:40Z</dc:date>
    </item>
  </channel>
</rss>

