<?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: Zipping files with password on Unix Server in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Zipping-files-with-password-on-Unix-Server/m-p/582352#M165627</link>
    <description>&lt;P&gt;So my problem did not get solved with the pipe method...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was given the following:&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;%let file1 = /data/fnb/hr_intelligence/OutPut_Data/Weekly/Position_Rpt2_&amp;amp;DAY0_DATE9..xlsx; /* Assign macro variable, this is a path and your excel file name*/&lt;BR /&gt;%let passwd = MY_SECRET; /* Assign macro variable password to protect your file.*/&lt;BR /&gt;%let zippedFile = /data/fnb/hr_intelligence/OutPut_Data/ZIPs_Weekly/Position_Rpt2_&amp;amp;DAY0_DATE9..zip; /* creating a zipped folder.*/&lt;BR /&gt;x 'cd /data/fnb/hr_intelligence/OutPut_Data/Weekly/';/* change to the directory where you saved the files*/&lt;BR /&gt;x "zip --password &amp;amp;passwd &amp;amp;zippedFile &amp;amp;file1"; /* pass all macro variable created to zip and protect the file*/&lt;BR /&gt;x 'pwd';&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This worked once. Made the zipped file and put it in the correct zip folder the works.&lt;/P&gt;&lt;P&gt;When running it a day or so later it does not work. The report log is as follows:&lt;/P&gt;&lt;P&gt;917 data _null_;&lt;BR /&gt;918 %let file1 = /data/fnb/hr_intelligence/OutPut_Data/Weekly/Position_Rpt2_&amp;amp;DAY0_DATE9..xlsx; /* Assign macro&lt;BR /&gt;918 ! variable, this is a path and your excel file name*/&lt;BR /&gt;919 %let passwd = MY_SECRET; /* Assign macro variable password to protect your file.*/&lt;BR /&gt;920 %let zippedFile = /data/fnb/hr_intelligence/OutPut_Data/ZIPs_Weekly/Position_Rpt2_&amp;amp;DAY0_DATE9..zip; /* creating a zipped&lt;BR /&gt;920 ! folder.*/&lt;BR /&gt;921 x 'cd /data/fnb/hr_intelligence/OutPut_Data/Weekly/'&lt;BR /&gt;921 ! ;/* change to the directory where you saved the files*/&lt;BR /&gt;922 x "zip --password &amp;amp;passwd &amp;amp;zippedFile &amp;amp;file1"&lt;BR /&gt;922 ! ; /* pass all macro variable created to zip and protect the file*/&lt;BR /&gt;NOTE: Current working directory is '/data/fnb/hr_intelligence/OutPut_Data/Weekly'.&lt;BR /&gt;923 x 'pwd'&lt;BR /&gt;923 ! ;&lt;BR /&gt;924 run;&lt;/P&gt;&lt;P&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.01 seconds&lt;BR /&gt;cpu time 0.00 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is nothing created in the Zip drive!!!&lt;/P&gt;&lt;P&gt;Why would it work 1 day and not the next?&lt;/P&gt;</description>
    <pubDate>Tue, 20 Aug 2019 09:14:39 GMT</pubDate>
    <dc:creator>ColleenCB</dc:creator>
    <dc:date>2019-08-20T09:14:39Z</dc:date>
    <item>
      <title>Zipping files with password on Unix Server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Zipping-files-with-password-on-Unix-Server/m-p/578651#M164151</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Once again we are changing systems from SAS Base 9.4 to Unix Enterprise Guide 7.15 and using SAS Manangement console to run the schedules.&lt;/P&gt;&lt;P&gt;We got PKZIP25 working on Base, but I seem to have an issue with it on EG.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is what the Code looks like and the resulting Log:&lt;/P&gt;&lt;P&gt;916 data _null_ ;&lt;/P&gt;&lt;P&gt;917 zipexe = '"/data/fnb/hr_intelligence/Scripts Programs/REQUIRED_PROGRAMS/PKZIP25.EXE" -min -a -s';&lt;BR /&gt;918 pw="&amp;amp;pwdit";&lt;BR /&gt;919 zipfile="/data/fnb/hr_intelligence/OutPut_Data/ZIPs_Monthly/BISM060_&amp;amp;MON1_&lt;BR /&gt;919 ! MONYY7..zip";&lt;BR /&gt;920 files="&amp;amp;MnlyOut./BISM060_&amp;amp;MON1_MONYY7..xlsx";&lt;BR /&gt;921 cmd=zipexe || pw || ' ' || zipfile || ' ' || files ;&lt;BR /&gt;922 putlog "NOTE-Processing command " cmd ;&lt;BR /&gt;923 call system( cmd ) ;&lt;BR /&gt;924 run;&lt;/P&gt;&lt;P&gt;Processing command&lt;BR /&gt;"/data/fnb/hr_intelligence/Scripts Programs/REQUIRED_PROGRAMS/PKZIP25.EXE" -min -a -sPSWd /data/fnb/hr_intelligence/OutPut_Data/ZIPs_Monthly/BISM060_JUL2019.zip /data/fnb/hr_intelligence/OutPut_Data/Monthly/BISM060_JUL2019.xlsx&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.05 seconds&lt;BR /&gt;cpu time 0.00 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It seems to run but I cannot find the Zip file in the directory as specified.&lt;/P&gt;&lt;P&gt;Those with the knowledge of the insides &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; , did this actually process correctly or what went wrong?&lt;/P&gt;&lt;P&gt;Should I be using something else to zip with?&lt;/P&gt;&lt;P&gt;Thank you for sharing your knowledge.&lt;/P&gt;&lt;P&gt;Have a great day&lt;/P&gt;</description>
      <pubDate>Fri, 02 Aug 2019 10:46:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Zipping-files-with-password-on-Unix-Server/m-p/578651#M164151</guid>
      <dc:creator>ColleenCB</dc:creator>
      <dc:date>2019-08-02T10:46:45Z</dc:date>
    </item>
    <item>
      <title>Re: Zipping files with password on Unix Server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Zipping-files-with-password-on-Unix-Server/m-p/578655#M164154</link>
      <description>PKZIP25.EXE is file with instructions for a computer running Windows. That will only run on a Windows host. If you are on UNIX you will need to use a program specifically for the operating system you are running. If you are on Linux you'd likely use the zip program that your Linux system administrators deploy. You can read the zip manual page for Linux here &lt;A href="https://linux.die.net/man/1/zip" target="_blank"&gt;https://linux.die.net/man/1/zip&lt;/A&gt;</description>
      <pubDate>Fri, 02 Aug 2019 10:59:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Zipping-files-with-password-on-Unix-Server/m-p/578655#M164154</guid>
      <dc:creator>SimonDawson</dc:creator>
      <dc:date>2019-08-02T10:59:35Z</dc:date>
    </item>
    <item>
      <title>Re: Zipping files with password on Unix Server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Zipping-files-with-password-on-Unix-Server/m-p/578692#M164172</link>
      <description>&lt;P&gt;And use the filename pipe method to run your external command:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename oscmd pipe "put your whole command here 2&amp;gt;&amp;amp;1";

data _null_;
infile oscmd;
input;
put _infile_;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;so you can see all responses (normal and error) in the SAS log.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Aug 2019 13:21:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Zipping-files-with-password-on-Unix-Server/m-p/578692#M164172</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-08-02T13:21:48Z</dc:date>
    </item>
    <item>
      <title>Re: Zipping files with password on Unix Server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Zipping-files-with-password-on-Unix-Server/m-p/582352#M165627</link>
      <description>&lt;P&gt;So my problem did not get solved with the pipe method...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was given the following:&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;%let file1 = /data/fnb/hr_intelligence/OutPut_Data/Weekly/Position_Rpt2_&amp;amp;DAY0_DATE9..xlsx; /* Assign macro variable, this is a path and your excel file name*/&lt;BR /&gt;%let passwd = MY_SECRET; /* Assign macro variable password to protect your file.*/&lt;BR /&gt;%let zippedFile = /data/fnb/hr_intelligence/OutPut_Data/ZIPs_Weekly/Position_Rpt2_&amp;amp;DAY0_DATE9..zip; /* creating a zipped folder.*/&lt;BR /&gt;x 'cd /data/fnb/hr_intelligence/OutPut_Data/Weekly/';/* change to the directory where you saved the files*/&lt;BR /&gt;x "zip --password &amp;amp;passwd &amp;amp;zippedFile &amp;amp;file1"; /* pass all macro variable created to zip and protect the file*/&lt;BR /&gt;x 'pwd';&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This worked once. Made the zipped file and put it in the correct zip folder the works.&lt;/P&gt;&lt;P&gt;When running it a day or so later it does not work. The report log is as follows:&lt;/P&gt;&lt;P&gt;917 data _null_;&lt;BR /&gt;918 %let file1 = /data/fnb/hr_intelligence/OutPut_Data/Weekly/Position_Rpt2_&amp;amp;DAY0_DATE9..xlsx; /* Assign macro&lt;BR /&gt;918 ! variable, this is a path and your excel file name*/&lt;BR /&gt;919 %let passwd = MY_SECRET; /* Assign macro variable password to protect your file.*/&lt;BR /&gt;920 %let zippedFile = /data/fnb/hr_intelligence/OutPut_Data/ZIPs_Weekly/Position_Rpt2_&amp;amp;DAY0_DATE9..zip; /* creating a zipped&lt;BR /&gt;920 ! folder.*/&lt;BR /&gt;921 x 'cd /data/fnb/hr_intelligence/OutPut_Data/Weekly/'&lt;BR /&gt;921 ! ;/* change to the directory where you saved the files*/&lt;BR /&gt;922 x "zip --password &amp;amp;passwd &amp;amp;zippedFile &amp;amp;file1"&lt;BR /&gt;922 ! ; /* pass all macro variable created to zip and protect the file*/&lt;BR /&gt;NOTE: Current working directory is '/data/fnb/hr_intelligence/OutPut_Data/Weekly'.&lt;BR /&gt;923 x 'pwd'&lt;BR /&gt;923 ! ;&lt;BR /&gt;924 run;&lt;/P&gt;&lt;P&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.01 seconds&lt;BR /&gt;cpu time 0.00 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is nothing created in the Zip drive!!!&lt;/P&gt;&lt;P&gt;Why would it work 1 day and not the next?&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2019 09:14:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Zipping-files-with-password-on-Unix-Server/m-p/582352#M165627</guid>
      <dc:creator>ColleenCB</dc:creator>
      <dc:date>2019-08-20T09:14:39Z</dc:date>
    </item>
    <item>
      <title>Re: Zipping files with password on Unix Server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Zipping-files-with-password-on-Unix-Server/m-p/582374#M165643</link>
      <description>&lt;P&gt;The filename pipe method won't make your code work in some magical way, but it grabs all responses from the command and puts it into the SAS log. X does not do that. Right now, you have no clue at all what went wrong, and there's nothing in the log (as you can see) to help us to help you.&lt;/P&gt;
&lt;P&gt;Using the pipe method will supply the necessary diagnostic information.&lt;/P&gt;
&lt;P&gt;So please run&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename oscmd pipe "zip --password &amp;amp;passwd &amp;amp;zippedFile &amp;amp;file1 2&amp;gt;&amp;amp;1";

data _null_;
infile oscmd;
input;
put _infile_;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and then post the log here, using the {i} button.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2019 11:03:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Zipping-files-with-password-on-Unix-Server/m-p/582374#M165643</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-08-20T11:03:34Z</dc:date>
    </item>
  </channel>
</rss>

