<?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: Problems when encrypting file within a macro in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Problems-when-encrypting-file-within-a-macro/m-p/872398#M344673</link>
    <description>&lt;P&gt;I would suspect that it is related to running the 7Zip call in batch that is the problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could be as simple as the different run styles having different search paths so that 7Zip call does not work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could be related to verbose options on the 7Zip call.&amp;nbsp; I had trouble in the past with a compression program that was designed to write a status line on the terminal as it compressed the data. (5/10... 6/10... somthing like that).&amp;nbsp; When run in background it made such a long line of junk it broke something.&amp;nbsp; The solution was to simply add the quiet/silent option to the command call so that it did not write out that junk.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With encryption I would check that it is not waiting for the non-existent user to respond to some confirmation prompt. Again check for an option to prevent that.&lt;/P&gt;</description>
    <pubDate>Wed, 26 Apr 2023 21:31:47 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2023-04-26T21:31:47Z</dc:date>
    <item>
      <title>Problems when encrypting file within a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problems-when-encrypting-file-within-a-macro/m-p/872396#M344672</link>
      <description>&lt;P&gt;Hello all! This problem is not easy to explain, and I don't expect fast answer. I'm working with automated SAS productions running daily. Programs are running every day and run completely only on specific days to produce reports. Programs which produce reports are in a macro making them running on those specific days. So, programs producing reports are called by %include in that macro. Reports are encrypted with 7zip, then sent by email. When program is run manually, everything is working fine. When it gets automated, it produced the report but it doesn't encrypt it. Because encrypted files doesn't exist, email isn't sent.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Only solution found is to create a 2nd macro calling the encrypting and the mailing after and outside the original macro reading the date to launch the production. I wonder if anyone already had that problem and/or how to solve it without the need to create a 2nd macro for encrypting and mailing results.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Feel free to ask for more explanation, I could put some piece of code, but it wouldn't be really significant regarding to the problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks and happy coding!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Marc.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2023 21:27:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problems-when-encrypting-file-within-a-macro/m-p/872396#M344672</guid>
      <dc:creator>marc11235</dc:creator>
      <dc:date>2023-04-26T21:27:05Z</dc:date>
    </item>
    <item>
      <title>Re: Problems when encrypting file within a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problems-when-encrypting-file-within-a-macro/m-p/872398#M344673</link>
      <description>&lt;P&gt;I would suspect that it is related to running the 7Zip call in batch that is the problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could be as simple as the different run styles having different search paths so that 7Zip call does not work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could be related to verbose options on the 7Zip call.&amp;nbsp; I had trouble in the past with a compression program that was designed to write a status line on the terminal as it compressed the data. (5/10... 6/10... somthing like that).&amp;nbsp; When run in background it made such a long line of junk it broke something.&amp;nbsp; The solution was to simply add the quiet/silent option to the command call so that it did not write out that junk.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With encryption I would check that it is not waiting for the non-existent user to respond to some confirmation prompt. Again check for an option to prevent that.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2023 21:31:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problems-when-encrypting-file-within-a-macro/m-p/872398#M344673</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-04-26T21:31:47Z</dc:date>
    </item>
    <item>
      <title>Re: Problems when encrypting file within a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problems-when-encrypting-file-within-a-macro/m-p/872399#M344674</link>
      <description>Does the account running in batch have the right user permissions to zip files? I'm assuming the 7zip is occurring via a X command type logic? Instead of 7zip can you use ODS PACKAGE to zip the files which may eliminate the issue?</description>
      <pubDate>Wed, 26 Apr 2023 21:32:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problems-when-encrypting-file-within-a-macro/m-p/872399#M344674</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2023-04-26T21:32:24Z</dc:date>
    </item>
    <item>
      <title>Re: Problems when encrypting file within a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problems-when-encrypting-file-within-a-macro/m-p/872404#M344676</link>
      <description>&lt;P&gt;Thanks for that inspiring answer, I will investigate few things in my code/log related to your message. I'm just surprised that encrypting works when automated in 2 separated macros, that makes me think that 7zip path is working and it doesn't get stuck in junk... I'll keep you in touch with result, thanks again!&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2023 21:47:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problems-when-encrypting-file-within-a-macro/m-p/872404#M344676</guid>
      <dc:creator>marc11235</dc:creator>
      <dc:date>2023-04-26T21:47:06Z</dc:date>
    </item>
    <item>
      <title>Re: Problems when encrypting file within a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problems-when-encrypting-file-within-a-macro/m-p/872405#M344677</link>
      <description>&lt;P&gt;I use a 'call system' for encrypting with 7zip, I don't know about encrypting with ods package but I will check at it, thanks a lot for the idea!&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2023 21:50:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problems-when-encrypting-file-within-a-macro/m-p/872405#M344677</guid>
      <dc:creator>marc11235</dc:creator>
      <dc:date>2023-04-26T21:50:07Z</dc:date>
    </item>
    <item>
      <title>Re: Problems when encrypting file within a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problems-when-encrypting-file-within-a-macro/m-p/872409#M344678</link>
      <description>Looks like ods package/filename zip doesn't support encryption so you'll need to sort your account options for an encrypted zip file. &lt;BR /&gt;</description>
      <pubDate>Wed, 26 Apr 2023 22:29:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problems-when-encrypting-file-within-a-macro/m-p/872409#M344678</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2023-04-26T22:29:55Z</dc:date>
    </item>
    <item>
      <title>Re: Problems when encrypting file within a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problems-when-encrypting-file-within-a-macro/m-p/872417#M344681</link>
      <description>&lt;P&gt;I suggest you compare the values for the SAS system options XWAIT and XSYNC between your batch and interactive SAS sessions. Both of these change how CALL&amp;nbsp; SYSTEM behaves:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc options option = (xwait xsync);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Apr 2023 00:43:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problems-when-encrypting-file-within-a-macro/m-p/872417#M344681</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2023-04-27T00:43:32Z</dc:date>
    </item>
    <item>
      <title>Re: Problems when encrypting file within a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problems-when-encrypting-file-within-a-macro/m-p/872421#M344684</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/430544"&gt;@marc11235&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I use a 'call system' for encrypting with 7zip, I don't know about encrypting with ods package but I will check at it, thanks a lot for the idea!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I would avoid using CALL SYSTEM. Use a PIPE so your program and read the messages that the command generates.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  infile "command you want to run" pipe;
  input;
  put _infile_;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 27 Apr 2023 00:19:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problems-when-encrypting-file-within-a-macro/m-p/872421#M344684</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-04-27T00:19:35Z</dc:date>
    </item>
    <item>
      <title>Re: Problems when encrypting file within a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problems-when-encrypting-file-within-a-macro/m-p/872429#M344692</link>
      <description>&lt;P&gt;I will check what happen with option xsync, I use usually set options to noxwait, I suspect that it could be something as simple as that... What ever I find as interesting result, I will share!&lt;/P&gt;</description>
      <pubDate>Thu, 27 Apr 2023 02:18:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problems-when-encrypting-file-within-a-macro/m-p/872429#M344692</guid>
      <dc:creator>marc11235</dc:creator>
      <dc:date>2023-04-27T02:18:08Z</dc:date>
    </item>
    <item>
      <title>Re: Problems when encrypting file within a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problems-when-encrypting-file-within-a-macro/m-p/872430#M344693</link>
      <description>&lt;P&gt;Very interesting, I can't wait next day to start trying things! It feels like the break time will be busy about trying! Thanks Everybody for all good ideas, next step is to understand what happens and fix it properly, not to just make it works with a patch!&lt;/P&gt;</description>
      <pubDate>Thu, 27 Apr 2023 02:24:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problems-when-encrypting-file-within-a-macro/m-p/872430#M344693</guid>
      <dc:creator>marc11235</dc:creator>
      <dc:date>2023-04-27T02:24:02Z</dc:date>
    </item>
    <item>
      <title>Re: Problems when encrypting file within a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problems-when-encrypting-file-within-a-macro/m-p/872441#M344698</link>
      <description>&lt;P&gt;When you use the PIPE method (recommended), add&lt;/P&gt;
&lt;PRE&gt;2&amp;gt;&amp;amp;1&lt;/PRE&gt;
&lt;P&gt;to the end of your commandline. This reroutes stderr to stdout, so that the INFILE can also catch error messages which might otherwise end up in the big bit bucket.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Apr 2023 05:43:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problems-when-encrypting-file-within-a-macro/m-p/872441#M344698</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-04-27T05:43:40Z</dc:date>
    </item>
    <item>
      <title>Re: Problems when encrypting file within a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problems-when-encrypting-file-within-a-macro/m-p/872725#M344788</link>
      <description>&lt;P&gt;Sorry I been very busy probably like most of us, but I want to thanks everybody for support. I saw a few times the 'maxims' document rolling around, I will definitely read it, and if it is not one of them, I would add to sleep a day on the problem if you get stuck, fresh ideas will appear! It may takes a few days but I will get back with more details asap&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2023 02:45:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problems-when-encrypting-file-within-a-macro/m-p/872725#M344788</guid>
      <dc:creator>marc11235</dc:creator>
      <dc:date>2023-04-28T02:45:21Z</dc:date>
    </item>
    <item>
      <title>Re: Problems when encrypting file within a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problems-when-encrypting-file-within-a-macro/m-p/872730#M344790</link>
      <description>&lt;P&gt;Already there. See Maxim 52.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2023 05:08:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problems-when-encrypting-file-within-a-macro/m-p/872730#M344790</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-04-28T05:08:35Z</dc:date>
    </item>
  </channel>
</rss>

