title: SAS unzip a single sas7bdat file
body: <p>I've scoured the internet and cannot find exactly what I need. At the end of a SAS program, I zipped the final dataset (20GB) using the <code>ods package</code> method. My dataset now sits in a zipped folder as wanted. Now, I want to unzip and read in that <code>.sas7bdat</code> file and I'm not quite sure about the method. </p>
  
  <p>Below is an example that creates a permanent SAS dataset and zips it up. I am able to look within that zip file and "see" the dataset I need, but I have no idea how to unzip it and read it in:</p>
  
  <pre><code>** assign your path **;
  libname output "H:\SAS Example Code";
  %let path = H:\SAS Example Code;
  
  ** test data **;
  data output.class; set sashelp.class; run;
  
  ** zip the permanent SAS dataset **;
  ods package(zip) open nopf;
  ods package(zip) 
      add file="&amp;path./class.sas7bdat";
  ods package(zip) 
      publish archive        
      properties(
          archive_name= "sashelp.class.zip"                  
          archive_path="&amp;path."
          );
  ods package(zip) close;
  
  /* BELOW THIS LINE NEEDS WORK -- HOW DO I READ IN THIS DATASET? */
  
  ** assign filename and point to zip file **;
  filename inzip zip "&amp;path./sashelp.class.zip";
  
  ** view the .sas7bdat file within the zip file **;
  data contents(keep=memname);
      length memname $200;
      fid=dopen("inzip");
          if fid=0 then stop;
      memcount=dnum(fid);
          do i=1 to memcount;
              memname=dread(fid,i);
          output;
          end;
      rc=dclose(fid);
  run;
  </code></pre>