<?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: automate updating save date in several program headers in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/automate-updating-save-date-in-several-program-headers/m-p/843165#M333361</link>
    <description>&lt;P&gt;Big picture, wouldn't it be better to use a version control tool (e.g. git) for this need?&amp;nbsp; That would give you all the audit trail of history of changes, etc, without trying to manually track file modification dates on comments.&lt;/P&gt;</description>
    <pubDate>Tue, 08 Nov 2022 16:01:44 GMT</pubDate>
    <dc:creator>Quentin</dc:creator>
    <dc:date>2022-11-08T16:01:44Z</dc:date>
    <item>
      <title>automate updating save date in several program headers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/automate-updating-save-date-in-several-program-headers/m-p/842920#M333290</link>
      <description>&lt;P&gt;Hi all, I need to update the save date in a bunch of program headers. For confidentiality reasons, most of the program header was omitted but it looks like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;****************************************************  
SAVE DATE OF PROGRAM
  (PRIOR TO FIRST DELIVERY):  21OCT2022
*******************************************************;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Pretend I have 60 programs in the same folder where I need to change the date to the current date, in this case: 07NOV2022. How would I accomplish this? No way am I trying to open each program one at a time to change the date. It's inside a comment block at the top of the program, else I'd use an automatic SAS macro variable like SYSDATE9. I will need to keep the program the header the same since it's standardized. Looking for help to automate it&lt;/P&gt;</description>
      <pubDate>Mon, 07 Nov 2022 17:30:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/automate-updating-save-date-in-several-program-headers/m-p/842920#M333290</guid>
      <dc:creator>tarheel13</dc:creator>
      <dc:date>2022-11-07T17:30:40Z</dc:date>
    </item>
    <item>
      <title>Re: automate updating save date in several program headers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/automate-updating-save-date-in-several-program-headers/m-p/842923#M333292</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;EM&gt;Pretend I have 60 programs in the same folder where I need to change the date to the current date, in this case: 07NOV2022. How would I accomplish this? No way am I trying to open each program one at a time to change the date.&lt;/EM&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You could use a program like Notepad++ that can find all programs in a folder and change whatever text is there to whatever else you specify, such as &amp;amp;sysdate.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;But other than that, I am having difficulty understanding what the problem requirements are. Forgetting the issue that you have 60 programs in the same folder, what is the desired result for program 1? Does this date in the header change every day?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Nov 2022 17:52:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/automate-updating-save-date-in-several-program-headers/m-p/842923#M333292</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-11-07T17:52:04Z</dc:date>
    </item>
    <item>
      <title>Re: automate updating save date in several program headers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/automate-updating-save-date-in-several-program-headers/m-p/842924#M333293</link>
      <description>&lt;P&gt;The date has to be changed to the current date if it's not already.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Nov 2022 17:50:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/automate-updating-save-date-in-several-program-headers/m-p/842924#M333293</guid>
      <dc:creator>tarheel13</dc:creator>
      <dc:date>2022-11-07T17:50:30Z</dc:date>
    </item>
    <item>
      <title>Re: automate updating save date in several program headers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/automate-updating-save-date-in-several-program-headers/m-p/842925#M333294</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/181158"&gt;@tarheel13&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;The date has to be changed to the current date if it's not already.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;It has to be changed every day in all 60 of the programs? So tomorrow they all have text 08NOV2022? And the next day they all have text 09NOV2022? And so on?&lt;/P&gt;</description>
      <pubDate>Mon, 07 Nov 2022 17:56:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/automate-updating-save-date-in-several-program-headers/m-p/842925#M333294</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-11-07T17:56:51Z</dc:date>
    </item>
    <item>
      <title>Re: automate updating save date in several program headers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/automate-updating-save-date-in-several-program-headers/m-p/842927#M333295</link>
      <description>&lt;P&gt;It's throwing warnings in the log. I don't think it has to be changed daily.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Nov 2022 17:56:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/automate-updating-save-date-in-several-program-headers/m-p/842927#M333295</guid>
      <dc:creator>tarheel13</dc:creator>
      <dc:date>2022-11-07T17:56:21Z</dc:date>
    </item>
    <item>
      <title>Re: automate updating save date in several program headers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/automate-updating-save-date-in-several-program-headers/m-p/842929#M333297</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/181158"&gt;@tarheel13&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;It's throwing warnings in the log. I don't think it has to be changed daily.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;This is the first that you have mentioned this. Please show us the warnings and associated code as it appears in the log. (And every time in the future, if there are warnings or errors in the log, show us the log including the code as it appears in the log). Please copy the log as text and paste it into the window that appears when you click on the &amp;lt;/&amp;gt; icon.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PaigeMiller_0-1663012019648.png" style="width: 859px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/75161i0E71B1489A6C9839/image-size/large?v=v2&amp;amp;px=999" role="button" title="PaigeMiller_0-1663012019648.png" alt="PaigeMiller_0-1663012019648.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But honestly, I'm still lost on what the requirements are. Maybe someone else understands.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Nov 2022 17:59:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/automate-updating-save-date-in-several-program-headers/m-p/842929#M333297</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-11-07T17:59:22Z</dc:date>
    </item>
    <item>
      <title>Re: automate updating save date in several program headers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/automate-updating-save-date-in-several-program-headers/m-p/842955#M333305</link>
      <description>&lt;P&gt;I wanted to automate it rather than change the date manually. the warnings are probably intentionally put there and not usual SAS warnings.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Nov 2022 19:48:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/automate-updating-save-date-in-several-program-headers/m-p/842955#M333305</guid>
      <dc:creator>tarheel13</dc:creator>
      <dc:date>2022-11-07T19:48:15Z</dc:date>
    </item>
    <item>
      <title>Re: automate updating save date in several program headers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/automate-updating-save-date-in-several-program-headers/m-p/842958#M333306</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/181158"&gt;@tarheel13&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I wanted to automate it rather than change the date manually. the warnings are probably intentionally put there and not usual SAS warnings.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Automate what? I still don't grasp that part of the project.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Today, you want to put the date 07NOV2022 into the file headers for all 60 programs? Then tomorrow, what? And the day after that, what?&lt;/P&gt;</description>
      <pubDate>Mon, 07 Nov 2022 20:09:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/automate-updating-save-date-in-several-program-headers/m-p/842958#M333306</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-11-07T20:09:46Z</dc:date>
    </item>
    <item>
      <title>Re: automate updating save date in several program headers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/automate-updating-save-date-in-several-program-headers/m-p/842993#M333323</link>
      <description>&lt;P&gt;Are you changing the "date" in a comment?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A data step to 1) read the file as text , 2) write ,most, of the file as existing text and 3) modify the date on one line? Is the line that the date appears on the same in all of the files? Is the column the same?&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, 07 Nov 2022 21:46:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/automate-updating-save-date-in-several-program-headers/m-p/842993#M333323</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-11-07T21:46:48Z</dc:date>
    </item>
    <item>
      <title>Re: automate updating save date in several program headers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/automate-updating-save-date-in-several-program-headers/m-p/843088#M333348</link>
      <description>&lt;P&gt;hey I can show the blank program header later and yes, it is in a comment block. anyway, the reason this all matters is because there are audits. So there is a modification history section and a last save date prior to delivery. Yesterday, someone was expecting me to update like 60 programs manually and I want to automate this so I never have to open 60 programs again and change the program header. Yesterday, I stumbled across a macro that may have some code I can use. So the save date prior to FIRST delivery does not seem as if it should be changed since the first delivery already happened on this project. However, then the modification history needs to match LAST SYSTEM SAVE DATE. someone has a macro checking the program header and it will put warnings if last modification date and last system save date are not equal. things like that I'm trying to fix and not do manually. so if someone went and made modifications today, then the modification history would have to say 08NOV2022 and the date the program was saved should also be 08NOV2022. trying to find a way to fix the dates without opening them one at a time. additionally, yesterday I had to update the protocol number in program header like 60 times just to use _ instead of -.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Agree that using a data step will work. I am thinking to get the program names in a macro variable list and loop over it and then write 2 data steps that can change the necessary things like protocol number or save/modification dates. ultimately, the time spent coming up with a solution for this will be worth it as I won't have to update 60+ programs one at a time again by opening up the program in SAS EG and revising the header block.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2022 11:29:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/automate-updating-save-date-in-several-program-headers/m-p/843088#M333348</guid>
      <dc:creator>tarheel13</dc:creator>
      <dc:date>2022-11-08T11:29:51Z</dc:date>
    </item>
    <item>
      <title>Re: automate updating save date in several program headers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/automate-updating-save-date-in-several-program-headers/m-p/843135#M333354</link>
      <description>&lt;P&gt;UNIX systems provide the perfect tool for conditional, scripted editing of text files, it's called awk.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2022 14:38:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/automate-updating-save-date-in-several-program-headers/m-p/843135#M333354</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-11-08T14:38:07Z</dc:date>
    </item>
    <item>
      <title>Re: automate updating save date in several program headers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/automate-updating-save-date-in-several-program-headers/m-p/843138#M333355</link>
      <description>&lt;P&gt;I can hardly grasp why it could be necessary to change the header of a program without modifying its contents. But if i had to do it, i would use a scripting language, like awk on linux or powershell on windows.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2022 14:41:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/automate-updating-save-date-in-several-program-headers/m-p/843138#M333355</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2022-11-08T14:41:18Z</dc:date>
    </item>
    <item>
      <title>Re: automate updating save date in several program headers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/automate-updating-save-date-in-several-program-headers/m-p/843146#M333357</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15475"&gt;@andreas_lds&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I can hardly grasp why it could be necessary to change the header of a program without modifying its contents. But if i had to do it, i would use a scripting language, like awk on linux or powershell on windows.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Actually changing the header changes the contents. Timing might mean that OP is still not "in compliance" with auditing if the header update occurs after the program runs. And I find the concept of a date-only to be a bit off as a program can be modified multiple times in a day, though it sounds like this might not be one.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2022 15:29:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/automate-updating-save-date-in-several-program-headers/m-p/843146#M333357</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-11-08T15:29:19Z</dc:date>
    </item>
    <item>
      <title>Re: automate updating save date in several program headers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/automate-updating-save-date-in-several-program-headers/m-p/843164#M333360</link>
      <description>&lt;P&gt;yea I was disappointed that we aren't using UNIX here. I know unix commands&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2022 16:00:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/automate-updating-save-date-in-several-program-headers/m-p/843164#M333360</guid>
      <dc:creator>tarheel13</dc:creator>
      <dc:date>2022-11-08T16:00:10Z</dc:date>
    </item>
    <item>
      <title>Re: automate updating save date in several program headers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/automate-updating-save-date-in-several-program-headers/m-p/843165#M333361</link>
      <description>&lt;P&gt;Big picture, wouldn't it be better to use a version control tool (e.g. git) for this need?&amp;nbsp; That would give you all the audit trail of history of changes, etc, without trying to manually track file modification dates on comments.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2022 16:01:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/automate-updating-save-date-in-several-program-headers/m-p/843165#M333361</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2022-11-08T16:01:44Z</dc:date>
    </item>
    <item>
      <title>Re: automate updating save date in several program headers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/automate-updating-save-date-in-several-program-headers/m-p/843168#M333363</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/181158"&gt;@tarheel13&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;The date has to be changed to the current date if it's not already.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Why?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Did you make other changes to these files today and forget to update the comment block?&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2022 16:12:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/automate-updating-save-date-in-several-program-headers/m-p/843168#M333363</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-11-08T16:12:14Z</dc:date>
    </item>
  </channel>
</rss>

