<?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: modifying sas codes or sas files using anonther sas file in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/modifying-sas-codes-or-sas-files-using-anonther-sas-file/m-p/549274#M8649</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;A id="link_8" class="lia-link-navigation lia-page-link lia-user-name-link" href="https://communities.sas.com/t5/user/viewprofilepage/user-id/269798" target="_self"&gt;&lt;SPAN class=""&gt;nathilanga,&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could write some Base SAS code to do this, but for 20 files, it would probably be simpler to do it manually.&lt;BR /&gt;&lt;BR /&gt;If you are going to be doing this on a regular basis, and want to write some SAS code to do it, then I'd approach it as follows&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Determine the files to be updated (&lt;A href="https://go.documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=allprodslang&amp;amp;docsetTarget=syntaxByCategory-function.htm&amp;amp;locale=en#p0jcp5on94ixz4n1ryzovr9aahca" target="_self"&gt;External File Functions&lt;/A&gt;)&lt;/LI&gt;
&lt;LI&gt;Read each file into SAS (&lt;A href="https://go.documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=lrcon&amp;amp;docsetTarget=p0mxi5r1wr8da8n1so87zpnzf2tc.htm&amp;amp;locale=en" target="_self"&gt;Working with External Files&lt;/A&gt;)&lt;/LI&gt;
&lt;LI&gt;Do the replace (&lt;A href="https://go.documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=allprodslang&amp;amp;docsetTarget=syntaxByCategory-function.htm&amp;amp;locale=en#p10ozukm5p5hd0n1me0bs6n0cplf" target="_self"&gt;Character String Matching Functions&lt;/A&gt;)&lt;/LI&gt;
&lt;LI&gt;Save each file with a new file name&amp;nbsp;(&lt;A href="https://go.documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=lrcon&amp;amp;docsetTarget=p0mxi5r1wr8da8n1so87zpnzf2tc.htm&amp;amp;locale=en" target="_self"&gt;Working with External Files&lt;/A&gt;)&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 08 Apr 2019 14:06:22 GMT</pubDate>
    <dc:creator>AMSAS</dc:creator>
    <dc:date>2019-04-08T14:06:22Z</dc:date>
    <item>
      <title>modifying sas codes or sas files using anonther sas file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/modifying-sas-codes-or-sas-files-using-anonther-sas-file/m-p/549252#M8646</link>
      <description>&lt;P&gt;Good day&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;have a list 20 of programs&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sales.sas&lt;/P&gt;&lt;P&gt;Marketing.sas&lt;/P&gt;&lt;P&gt;HR.sas&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;all these they have a common macro variable called currentReporingmonth i want to iterate through all of them to find and replace that variable with mon1_date9 and output another sas code with chagnes or file for example&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sales.sas -&amp;gt; Sales1.sas&lt;/P&gt;&lt;P&gt;Marketing.sas -&amp;gt; Marketing1.sas&lt;/P&gt;&lt;P&gt;HR.sas -&amp;gt; HR1.sas&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your help will be highly appreciated&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;N&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Apr 2019 13:08:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/modifying-sas-codes-or-sas-files-using-anonther-sas-file/m-p/549252#M8646</guid>
      <dc:creator>nathilanga</dc:creator>
      <dc:date>2019-04-08T13:08:29Z</dc:date>
    </item>
    <item>
      <title>Re: modifying sas codes or sas files using anonther sas file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/modifying-sas-codes-or-sas-files-using-anonther-sas-file/m-p/549274#M8649</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;A id="link_8" class="lia-link-navigation lia-page-link lia-user-name-link" href="https://communities.sas.com/t5/user/viewprofilepage/user-id/269798" target="_self"&gt;&lt;SPAN class=""&gt;nathilanga,&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could write some Base SAS code to do this, but for 20 files, it would probably be simpler to do it manually.&lt;BR /&gt;&lt;BR /&gt;If you are going to be doing this on a regular basis, and want to write some SAS code to do it, then I'd approach it as follows&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Determine the files to be updated (&lt;A href="https://go.documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=allprodslang&amp;amp;docsetTarget=syntaxByCategory-function.htm&amp;amp;locale=en#p0jcp5on94ixz4n1ryzovr9aahca" target="_self"&gt;External File Functions&lt;/A&gt;)&lt;/LI&gt;
&lt;LI&gt;Read each file into SAS (&lt;A href="https://go.documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=lrcon&amp;amp;docsetTarget=p0mxi5r1wr8da8n1so87zpnzf2tc.htm&amp;amp;locale=en" target="_self"&gt;Working with External Files&lt;/A&gt;)&lt;/LI&gt;
&lt;LI&gt;Do the replace (&lt;A href="https://go.documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=allprodslang&amp;amp;docsetTarget=syntaxByCategory-function.htm&amp;amp;locale=en#p10ozukm5p5hd0n1me0bs6n0cplf" target="_self"&gt;Character String Matching Functions&lt;/A&gt;)&lt;/LI&gt;
&lt;LI&gt;Save each file with a new file name&amp;nbsp;(&lt;A href="https://go.documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=lrcon&amp;amp;docsetTarget=p0mxi5r1wr8da8n1so87zpnzf2tc.htm&amp;amp;locale=en" target="_self"&gt;Working with External Files&lt;/A&gt;)&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Apr 2019 14:06:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/modifying-sas-codes-or-sas-files-using-anonther-sas-file/m-p/549274#M8649</guid>
      <dc:creator>AMSAS</dc:creator>
      <dc:date>2019-04-08T14:06:22Z</dc:date>
    </item>
    <item>
      <title>Re: modifying sas codes or sas files using anonther sas file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/modifying-sas-codes-or-sas-files-using-anonther-sas-file/m-p/549286#M8651</link>
      <description>&lt;P&gt;Why change the code? Do you assign a value to the macro variable in each file? If that is the case then a likely better approach would be to remove the assignment code an do that in a separate program that then calls the program files with %include statements.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since you don't actually provide the 1) current macro variable name, 2) how that particular macro variable is used, 3) what you explicitly want the macro variable changed to and 4) source code of at least one of those files, it is very hard to provide any actual concrete code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And things may get more complicated if any of your program files define or call macros.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Apr 2019 14:34:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/modifying-sas-codes-or-sas-files-using-anonther-sas-file/m-p/549286#M8651</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-04-08T14:34:39Z</dc:date>
    </item>
    <item>
      <title>Re: modifying sas codes or sas files using anonther sas file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/modifying-sas-codes-or-sas-files-using-anonther-sas-file/m-p/549307#M8654</link>
      <description>&lt;P&gt;A proper operating system (read: UNIX) provides a great tool for such text operations, it's called &lt;FONT face="courier new,courier"&gt;awk&lt;/FONT&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Apr 2019 15:18:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/modifying-sas-codes-or-sas-files-using-anonther-sas-file/m-p/549307#M8654</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-04-08T15:18:56Z</dc:date>
    </item>
    <item>
      <title>Re: modifying sas codes or sas files using anonther sas file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/modifying-sas-codes-or-sas-files-using-anonther-sas-file/m-p/549524#M8685</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;A proper operating system (read: UNIX) provides a great tool for such text operations, it's called &lt;FONT face="courier new,courier"&gt;awk&lt;/FONT&gt;.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;And Windoze has Powershell for the same job but i would use a text-editor allowing find+replace on multiple files in a folder, e.g. Notepad++.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Apr 2019 09:12:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/modifying-sas-codes-or-sas-files-using-anonther-sas-file/m-p/549524#M8685</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2019-04-09T09:12:52Z</dc:date>
    </item>
    <item>
      <title>Re: modifying sas codes or sas files using anonther sas file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/modifying-sas-codes-or-sas-files-using-anonther-sas-file/m-p/549567#M8698</link>
      <description>Good day&lt;BR /&gt;&lt;BR /&gt;i am still investigating its some thing that has to do with pipe and xcom in sas</description>
      <pubDate>Tue, 09 Apr 2019 12:52:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/modifying-sas-codes-or-sas-files-using-anonther-sas-file/m-p/549567#M8698</guid>
      <dc:creator>nathilanga</dc:creator>
      <dc:date>2019-04-09T12:52:43Z</dc:date>
    </item>
    <item>
      <title>Re: modifying sas codes or sas files using anonther sas file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/modifying-sas-codes-or-sas-files-using-anonther-sas-file/m-p/549569#M8699</link>
      <description>&lt;P&gt;Good day&lt;/P&gt;&lt;P&gt;reason for the code change is to standardize it, i have plenty of code that needs to change&amp;nbsp;&lt;/P&gt;&lt;P&gt;so that everyone can use one auto exec for libraries and dates&lt;/P&gt;</description>
      <pubDate>Tue, 09 Apr 2019 12:54:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/modifying-sas-codes-or-sas-files-using-anonther-sas-file/m-p/549569#M8699</guid>
      <dc:creator>nathilanga</dc:creator>
      <dc:date>2019-04-09T12:54:18Z</dc:date>
    </item>
  </channel>
</rss>

