<?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 How to readin text file inside a zipped file without zipping?! in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-readin-text-file-inside-a-zipped-file-without-zipping/m-p/978566#M378631</link>
    <description>&lt;P&gt;I have a zipped file with thousands of text files, and just need readin a few of them.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How to readin text file inside a zipped file without zipping?! Is that possible?&lt;/P&gt;
&lt;P&gt;Say the zipped file name is filezipped.zip and the file inside need be readin is file_0001.txt.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What would be the sample code?!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I know how to unzip the file within SAS and readin text file.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 08 Nov 2025 15:06:56 GMT</pubDate>
    <dc:creator>hellohere</dc:creator>
    <dc:date>2025-11-08T15:06:56Z</dc:date>
    <item>
      <title>How to readin text file inside a zipped file without zipping?!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-readin-text-file-inside-a-zipped-file-without-zipping/m-p/978566#M378631</link>
      <description>&lt;P&gt;I have a zipped file with thousands of text files, and just need readin a few of them.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How to readin text file inside a zipped file without zipping?! Is that possible?&lt;/P&gt;
&lt;P&gt;Say the zipped file name is filezipped.zip and the file inside need be readin is file_0001.txt.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What would be the sample code?!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I know how to unzip the file within SAS and readin text file.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 08 Nov 2025 15:06:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-readin-text-file-inside-a-zipped-file-without-zipping/m-p/978566#M378631</guid>
      <dc:creator>hellohere</dc:creator>
      <dc:date>2025-11-08T15:06:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to readin text file inside a zipped file without zipping?!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-readin-text-file-inside-a-zipped-file-without-zipping/m-p/978570#M378633</link>
      <description>&lt;P&gt;First, define a file reference for the zip archive, then use this with a member name in the DATA step.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename zipfile zip "/path_to_file/filezipped.zip";

data want;
infile zip(file_0001.txt) /* other options */;
length ....;
format ....;
input ....;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 08 Nov 2025 16:47:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-readin-text-file-inside-a-zipped-file-without-zipping/m-p/978570#M378633</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2025-11-08T16:47:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to readin text file inside a zipped file without zipping?!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-readin-text-file-inside-a-zipped-file-without-zipping/m-p/978571#M378634</link>
      <description>&lt;P&gt;For reference, see Example 3 of&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lestmtsglobal/n1dn0f61yfyzton1l2ngsa1clllr.htm#p0c653wf2di4jln10vjxwuub1ptz" target="_blank" rel="noopener"&gt;FILENAME Statement: ZIP Access Method&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(Maxim 1: Read the Documentation)&lt;/P&gt;</description>
      <pubDate>Sat, 08 Nov 2025 16:51:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-readin-text-file-inside-a-zipped-file-without-zipping/m-p/978571#M378634</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2025-11-08T16:51:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to readin text file inside a zipped file without zipping?!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-readin-text-file-inside-a-zipped-file-without-zipping/m-p/978573#M378635</link>
      <description>&lt;P&gt;You can read it using the ZIP fileref engine.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Either directly in the INFILE statement.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;infile 'filezipped.zip' zip member='file_0001.txt' ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or by first creating a FILEREF .&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename file1 zip 'filezipped.zip' member='file_0001.txt' ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and then using the fileref in the INFILE statement&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;infile file1 ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You could also use the fileref in other places where you might have used a physical filename. Such as PROC IMPORT.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc import file=file1 .....;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could also make a fileref that does not specify which member of the ZIP file to read.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename zipfile zip 'filezipped.zip' ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;That is the same as pointing a fileref at a directory .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the INFILE statement you can then select which member you want using the normal old fashion SAS syntax:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;infile zipfile('file_0001.txt') ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 08 Nov 2025 18:48:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-readin-text-file-inside-a-zipped-file-without-zipping/m-p/978573#M378635</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-11-08T18:48:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to readin text file inside a zipped file without zipping?!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-readin-text-file-inside-a-zipped-file-without-zipping/m-p/978645#M378665</link>
      <description>&lt;P&gt;How good is the documentation of the&amp;nbsp; file you want to read? As in do you know the variable type, length and possibly the needed Informat such as for dates, times or currency and matching display Format?&lt;/P&gt;</description>
      <pubDate>Tue, 11 Nov 2025 06:29:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-readin-text-file-inside-a-zipped-file-without-zipping/m-p/978645#M378665</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2025-11-11T06:29:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to readin text file inside a zipped file without zipping?!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-readin-text-file-inside-a-zipped-file-without-zipping/m-p/978677#M378670</link>
      <description>&lt;P&gt;For reference, we have several examples here:&amp;nbsp;&lt;LI-MESSAGE title="How to work with ZIP files in SAS programs" uid="964515" url="https://communities.sas.com/t5/SAS-Communities-Library/How-to-work-with-ZIP-files-in-SAS-programs/m-p/964515#U964515" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-tkb-thread lia-fa-icon lia-fa-tkb lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Nov 2025 14:08:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-readin-text-file-inside-a-zipped-file-without-zipping/m-p/978677#M378670</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2025-11-11T14:08:46Z</dc:date>
    </item>
  </channel>
</rss>

