<?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: NOT ABLE TO READ THE DATA PRESENT IN THE ZIP FILES INTO SAS DATA SET in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/NOT-ABLE-TO-READ-THE-DATA-PRESENT-IN-THE-ZIP-FILES-INTO-SAS-DATA/m-p/714430#M220563</link>
    <description>&lt;P&gt;Nothing in that code you show reads any data into SAS.&lt;/P&gt;
&lt;P&gt;That code apparently extracts and renames a CSV file. You need additional code to read the CSV file. Either a data step or Proc Import.&lt;/P&gt;</description>
    <pubDate>Tue, 26 Jan 2021 21:38:02 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2021-01-26T21:38:02Z</dc:date>
    <item>
      <title>NOT ABLE TO READ THE DATA PRESENT IN THE ZIP FILES INTO SAS DATA SET</title>
      <link>https://communities.sas.com/t5/SAS-Programming/NOT-ABLE-TO-READ-THE-DATA-PRESENT-IN-THE-ZIP-FILES-INTO-SAS-DATA/m-p/714427#M220562</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;I have large code written in the sas main.sas program, my problem is I couldn't able to read the data present in the zip files, when I also unzip the files with the macro written below...,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro unzip(file=, file_out=, path_zip=, path_unzip=);&lt;/P&gt;&lt;P&gt;/* Versione pre SAS94 */&lt;BR /&gt;%sysexec cd "C:\Program Files\7-Zip";/* deve contenere il path dell'eseguibile zip */&lt;BR /&gt;%sysexec 7z x "&amp;amp;path_zip.\&amp;amp;file..zip" "-o&amp;amp;path_unzip.";&lt;BR /&gt;%sysexec rename "&amp;amp;path_unzip.\&amp;amp;file..csv" "&amp;amp;file_out..csv";&lt;/P&gt;&lt;P&gt;%mend;&lt;BR /&gt;%unzip;&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;&lt;P&gt;but I don't understand where is the problem when I open the libraries and see the tables it doesn't contain any data it shows zero observations for me and also in log file I don't see any erros , this makes me not able to figure it out where might be the error. Any suggestions would be commendable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in andance.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2021 21:30:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/NOT-ABLE-TO-READ-THE-DATA-PRESENT-IN-THE-ZIP-FILES-INTO-SAS-DATA/m-p/714427#M220562</guid>
      <dc:creator>shailaja3</dc:creator>
      <dc:date>2021-01-26T21:30:13Z</dc:date>
    </item>
    <item>
      <title>Re: NOT ABLE TO READ THE DATA PRESENT IN THE ZIP FILES INTO SAS DATA SET</title>
      <link>https://communities.sas.com/t5/SAS-Programming/NOT-ABLE-TO-READ-THE-DATA-PRESENT-IN-THE-ZIP-FILES-INTO-SAS-DATA/m-p/714430#M220563</link>
      <description>&lt;P&gt;Nothing in that code you show reads any data into SAS.&lt;/P&gt;
&lt;P&gt;That code apparently extracts and renames a CSV file. You need additional code to read the CSV file. Either a data step or Proc Import.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2021 21:38:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/NOT-ABLE-TO-READ-THE-DATA-PRESENT-IN-THE-ZIP-FILES-INTO-SAS-DATA/m-p/714430#M220563</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-01-26T21:38:02Z</dc:date>
    </item>
    <item>
      <title>Re: NOT ABLE TO READ THE DATA PRESENT IN THE ZIP FILES INTO SAS DATA SET</title>
      <link>https://communities.sas.com/t5/SAS-Programming/NOT-ABLE-TO-READ-THE-DATA-PRESENT-IN-THE-ZIP-FILES-INTO-SAS-DATA/m-p/714460#M220575</link>
      <description>&lt;P&gt;You can read your data directly from the zip file and no unzipping necessary.&amp;nbsp;&lt;BR /&gt;This blog post illustrates the full process, including getting a zip file downloaded from the internet.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/sasdummy/2014/01/29/using-filename-zip/" target="_blank"&gt;https://blogs.sas.com/content/sasdummy/2014/01/29/using-filename-zip/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'll comment your code (which you should do) so you understand what it's doing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro unzip(file=, file_out=, path_zip=, path_unzip=);


*Opens the 7-zip application;
%sysexec cd "C:\Program Files\7-Zip";/* deve contenere il path dell'eseguibile zip */

*unzips the zipped file;
%sysexec 7z x "&amp;amp;path_zip.\&amp;amp;file..zip" "-o&amp;amp;path_unzip.";

*Renames the file to the desired file name;
%sysexec rename "&amp;amp;path_unzip.\&amp;amp;file..csv" "&amp;amp;file_out..csv";

%mend;
%unzip; * no parameters passed so that's problematic unless they were declared somewhere else; 
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You should be calling the macro as follows with parameters, but you didn't either so I don't think anything did happen anyways.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%unzip(file=Sample.zip , 
             file_out=Want , 
             path_zip=C:\temp\demo\ , 
             path_unzip= C:\temp\demo_out\)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;UCLA introductory tutorial on macro variables and macros&lt;BR /&gt;&lt;A href="https://stats.idre.ucla.edu/sas/seminars/sas-macros-introduction/" target="_blank"&gt;https://stats.idre.ucla.edu/sas/seminars/sas-macros-introduction/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Tutorial on converting a working program to a macro&lt;BR /&gt;This method is pretty robust and helps prevent errors and makes it much easier to debug your code. Obviously biased, because I wrote it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;A href="https://github.com/statgeek/SAS-Tutorials/blob/master/Turning%20a%20program%20into%20a%20macro.md" target="_blank"&gt;https://github.com/statgeek/SAS-Tutorials/blob/master/Turning%20a%20program%20into%20a%20macro.md&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Examples of common macro usage&lt;BR /&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/SAS-9-4-Macro-Language-Reference-Has-a-New-Appendix/ta-p/291716" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/SAS-9-4-Macro-Language-Reference-Has-a-New-Appendix/ta-p/291716&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/360246"&gt;@shailaja3&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi everyone,&lt;/P&gt;
&lt;P&gt;I have large code written in the sas main.sas program, my problem is I couldn't able to read the data present in the zip files, when I also unzip the files with the macro written below...,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%macro unzip(file=, file_out=, path_zip=, path_unzip=);&lt;/P&gt;
&lt;P&gt;/* Versione pre SAS94 */&lt;BR /&gt;%sysexec cd "C:\Program Files\7-Zip";/* deve contenere il path dell'eseguibile zip */&lt;BR /&gt;%sysexec 7z x "&amp;amp;path_zip.\&amp;amp;file..zip" "-o&amp;amp;path_unzip.";&lt;BR /&gt;%sysexec rename "&amp;amp;path_unzip.\&amp;amp;file..csv" "&amp;amp;file_out..csv";&lt;/P&gt;
&lt;P&gt;%mend;&lt;BR /&gt;%unzip;&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;
&lt;P&gt;but I don't understand where is the problem when I open the libraries and see the tables it doesn't contain any data it shows zero observations for me and also in log file I don't see any erros , this makes me not able to figure it out where might be the error. Any suggestions would be commendable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you in andance.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jan 2021 01:23:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/NOT-ABLE-TO-READ-THE-DATA-PRESENT-IN-THE-ZIP-FILES-INTO-SAS-DATA/m-p/714460#M220575</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-01-27T01:23:55Z</dc:date>
    </item>
  </channel>
</rss>

