<?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 Importing .csv.gz files in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Importing-csv-gz-files/m-p/970974#M377212</link>
    <description>&lt;P&gt;Can SAS import .csv.gz files instead of CSV files? My CSV file is so large that I therefore have to compress it to .csv.gz files and import them directly into statistical softwares. In addition, the file is so large that I have to select columns and rows with specific features in the course of import or else my computer would run out of memory. Can SAS do that?&lt;/P&gt;</description>
    <pubDate>Thu, 17 Jul 2025 10:02:49 GMT</pubDate>
    <dc:creator>Season</dc:creator>
    <dc:date>2025-07-17T10:02:49Z</dc:date>
    <item>
      <title>Importing .csv.gz files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-csv-gz-files/m-p/970974#M377212</link>
      <description>&lt;P&gt;Can SAS import .csv.gz files instead of CSV files? My CSV file is so large that I therefore have to compress it to .csv.gz files and import them directly into statistical softwares. In addition, the file is so large that I have to select columns and rows with specific features in the course of import or else my computer would run out of memory. Can SAS do that?&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jul 2025 10:02:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-csv-gz-files/m-p/970974#M377212</guid>
      <dc:creator>Season</dc:creator>
      <dc:date>2025-07-17T10:02:49Z</dc:date>
    </item>
    <item>
      <title>Re: Importing .csv.gz files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-csv-gz-files/m-p/970975#M377213</link>
      <description>&lt;P&gt;Define a file reference with the compression first, then use it in usual DATA step.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename in zip "your path to the file" gzip;

data want;
infile in
  dsd
  lrecl=....
  dlm=","
  truncover
;
length
  /* define your variables here */
;
format
  /* set formats for variables that need it (dates, times, etc.) */
;
input
  /* list all variables */
;
keep
  /* list all variables you want to keep */
;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 17 Jul 2025 10:45:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-csv-gz-files/m-p/970975#M377213</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2025-07-17T10:45:29Z</dc:date>
    </item>
    <item>
      <title>Re: Importing .csv.gz files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-csv-gz-files/m-p/970986#M377216</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/437457"&gt;@Season&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Can SAS import .csv.gz files instead of CSV files? My CSV file is so large that I therefore have to compress it to .csv.gz files and import them directly into statistical softwares. In addition, the file is so large that I have to select columns and rows with specific features in the course of import or else my computer would run out of memory. Can SAS do that?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;SAS can READ a gzipped file.&amp;nbsp; Use the ZIP engine with the GZIP option on the INFILE statement.&amp;nbsp; Or on the FILENAME statement if you are using one.&lt;/P&gt;
&lt;P&gt;Something like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  infile 'myfile.csv.gz' zip gzip dsd truncover firstobs=2;
  input var1 :$10. var2 var3 :date. ..... ;
  format var3 date9.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you need help with GUESSING how to read the file then use this macro:&amp;nbsp;&lt;A href="https://github.com/sasutils/macros/blob/master/csv2ds.sas" target="_blank"&gt;https://github.com/sasutils/macros/blob/master/csv2ds.sas&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;(Remember to also get the %parmv() macro from the same site).&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%csv2ds
("myfile.csv.gz" zip gzip 
,out=want
,replace=yes
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jul 2025 13:26:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-csv-gz-files/m-p/970986#M377216</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-07-17T13:26:41Z</dc:date>
    </item>
    <item>
      <title>Re: Importing .csv.gz files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-csv-gz-files/m-p/970989#M377218</link>
      <description>&lt;P&gt;Thank you so much for your solution! My questions are the same for both of you, so I will reply to one of the duo:&lt;/P&gt;
&lt;P&gt;(1) Does it mean that in importing .csv.gz files, we have to specify the features of all variables manually?&lt;/P&gt;
&lt;P&gt;(2) Is it possible to filter the observations in the course of importation instead of doing so post hoc, which is the usual practice? Can columns and rows both undergo filtering in the importation process?&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jul 2025 13:58:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-csv-gz-files/m-p/970989#M377218</guid>
      <dc:creator>Season</dc:creator>
      <dc:date>2025-07-17T13:58:24Z</dc:date>
    </item>
    <item>
      <title>Re: Importing .csv.gz files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-csv-gz-files/m-p/970992#M377219</link>
      <description>&lt;P&gt;Please explain how you tried to read the file.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am not to familiar with gzip, but i doubt that reading a file without unzipping it is possible. At some point of the process the file needs to uncompressed, to allow sas to read it line-by-line.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, how large is the file? How many variables are there?&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jul 2025 14:02:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-csv-gz-files/m-p/970992#M377219</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2025-07-17T14:02:01Z</dc:date>
    </item>
    <item>
      <title>Re: Importing .csv.gz files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-csv-gz-files/m-p/970993#M377220</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/437457"&gt;@Season&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thank you so much for your solution! My questions are the same for both of you, so I will reply to one of the duo:&lt;/P&gt;
&lt;P&gt;(1) Does it mean that in importing .csv.gz files, we have to specify the features of all variables manually?&lt;/P&gt;
&lt;P&gt;(2) Is it possible to filter the observations in the course of importation instead of doing so post hoc, which is the usual practice? Can columns and rows both undergo filtering in the importation process?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;CSV files do not have metadata that details their contents.&amp;nbsp; So you cannot directly IMPORT them like you would a table from a database.&amp;nbsp; Instead you need to write code to READ them, the same as would for reading any other text file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS does have a procedure called PROC IMPORT than you can use to help you GUESS how to read a CSV file.&amp;nbsp; &amp;nbsp;Unfortunately the code it uses to examine the file to make the guesses does not handle compressed file, even though the code it generates to actual read the file would.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When you are READING in a file using a data step you can use the power of the data step to decide which observations are written out.&amp;nbsp; Look up the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lestmtsref/p1cxl8ifdt8u0gn12wqbji8o5fq1.htm" target="_self"&gt;subsetting IF statement&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jul 2025 14:03:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-csv-gz-files/m-p/970993#M377220</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-07-17T14:03:45Z</dc:date>
    </item>
    <item>
      <title>Re: Importing .csv.gz files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-csv-gz-files/m-p/970994#M377221</link>
      <description>It is possible to read it in R. The compressed file is about 30G, with some 40 variables.</description>
      <pubDate>Thu, 17 Jul 2025 14:04:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-csv-gz-files/m-p/970994#M377221</guid>
      <dc:creator>Season</dc:creator>
      <dc:date>2025-07-17T14:04:21Z</dc:date>
    </item>
    <item>
      <title>Re: Importing .csv.gz files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-csv-gz-files/m-p/970995#M377222</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/437457"&gt;@Season&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;It is possible to read it in R. The compressed file is about 30G, with some 40 variables.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;What guesses did R make for how to define the 40 variables?&amp;nbsp; You could use those to help you write the code.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jul 2025 14:05:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-csv-gz-files/m-p/970995#M377222</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-07-17T14:05:18Z</dc:date>
    </item>
    <item>
      <title>Re: Importing .csv.gz files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-csv-gz-files/m-p/970996#M377223</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/437457"&gt;@Season&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;It is possible to read it in R. The compressed file is about 30G, with some 40 variables.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;What guesses did R make for how to define the 40 variables?&amp;nbsp; You could use those to help you write the code.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;A function is applied before importation of the whole compressed file to read its first row, which stores the names of variables. No such functions seem available in SAS, are there?&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jul 2025 14:08:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-csv-gz-files/m-p/970996#M377223</guid>
      <dc:creator>Season</dc:creator>
      <dc:date>2025-07-17T14:08:27Z</dc:date>
    </item>
    <item>
      <title>Re: Importing .csv.gz files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-csv-gz-files/m-p/970997#M377224</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/437457"&gt;@Season&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/437457"&gt;@Season&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;It is possible to read it in R. The compressed file is about 30G, with some 40 variables.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;What guesses did R make for how to define the 40 variables?&amp;nbsp; You could use those to help you write the code.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;A function is applied before importation of the whole compressed file to read its first row, which stores the names of variables. No such functions seems available in SAS, is there?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Huh?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you just want LOOK at the first line then write a data step to do that.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  infile 'myfile.csv.gz' zip gzip;
  input;
  put _infile_;
  stop;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It is trivial to read the names from the first line of a text file into a dataset if you want.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data names ;
  length name $32 label $256 ;
  infile 'myfile.csv.gz' zip gzip dsd obs=1 ;
  input label @@ ;
  name = label;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You might also want to use the LIST statement to get an idea what is in your file.&amp;nbsp; This step will dump the first 10 lines of the file to the SAS log.&amp;nbsp; The LIST statement will show the lines (and their length) and if any of the characters are non-printable it will also show the hexadecimal code for all of the characters in the line.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  infile 'myfile.csv.gz' zip gzip obs=10;
  input;
  list;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 17 Jul 2025 14:15:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-csv-gz-files/m-p/970997#M377224</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-07-17T14:15:25Z</dc:date>
    </item>
    <item>
      <title>Re: Importing .csv.gz files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-csv-gz-files/m-p/971000#M377226</link>
      <description>Thank you so much! That saves the time of manually typing the variable names in the DATA step.</description>
      <pubDate>Thu, 17 Jul 2025 14:17:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-csv-gz-files/m-p/971000#M377226</guid>
      <dc:creator>Season</dc:creator>
      <dc:date>2025-07-17T14:17:05Z</dc:date>
    </item>
    <item>
      <title>Re: Importing .csv.gz files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-csv-gz-files/m-p/971001#M377227</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/437457"&gt;@Season&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/437457"&gt;@Season&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;It is possible to read it in R. The compressed file is about 30G, with some 40 variables.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;What guesses did R make for how to define the 40 variables?&amp;nbsp; You could use those to help you write the code.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;A function is applied before importation of the whole compressed file to read its first row, which stores the names of variables. No such functions seem available in SAS, are there?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Note the NAME is the only metadata that a CSV file does have.&amp;nbsp; What it does not have is any information about what types of variables those names represent.&amp;nbsp; Are they character strings? If so how long. Are the numbers? Perhaps dates?&amp;nbsp; &amp;nbsp;That is where the guessing needs to happen.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jul 2025 14:18:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-csv-gz-files/m-p/971001#M377227</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-07-17T14:18:06Z</dc:date>
    </item>
    <item>
      <title>Re: Importing .csv.gz files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-csv-gz-files/m-p/971002#M377228</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/437457"&gt;@Season&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/437457"&gt;@Season&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;It is possible to read it in R. The compressed file is about 30G, with some 40 variables.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;What guesses did R make for how to define the 40 variables?&amp;nbsp; You could use those to help you write the code.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;A function is applied before importation of the whole compressed file to read its first row, which stores the names of variables. No such functions seem available in SAS, are there?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Note the NAME is the only metadata that a CSV file does have.&amp;nbsp; What it does not have is any information about what types of variables those names represent.&amp;nbsp; Are they character strings? If so how long. Are the numbers? Perhaps dates?&amp;nbsp; &amp;nbsp;That is where the guessing needs to happen.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Thank you for your reminder!&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jul 2025 14:19:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-csv-gz-files/m-p/971002#M377228</guid>
      <dc:creator>Season</dc:creator>
      <dc:date>2025-07-17T14:19:35Z</dc:date>
    </item>
    <item>
      <title>Re: Importing .csv.gz files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-csv-gz-files/m-p/971003#M377229</link>
      <description>&lt;P&gt;Once you have the code to read your file you could define it as a data step view and then use that for your filtering process of selecting particular observations or variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example you might create a data step like this one to make the view.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data full_file / view=full_file;
  infile 'myfile.csv.gz' zip gzip dsd truncover firstobs=2;
  length var1 $10 var2 8 var3 8 .... varlast $30 ;
  input var1--varlist;
  format var3 date9.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then if you wanted a subset with just some of the variables and only the observations where the date was after some cutoff you could do something like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set full_file;
  if var3 &amp;gt; '01JAN2025'd ;
  keep var1 var3 varlast;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 17 Jul 2025 14:28:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-csv-gz-files/m-p/971003#M377229</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-07-17T14:28:58Z</dc:date>
    </item>
    <item>
      <title>Re: Importing .csv.gz files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-csv-gz-files/m-p/971004#M377230</link>
      <description>So the selection process still takes place after the entire importation is done, right?</description>
      <pubDate>Thu, 17 Jul 2025 14:33:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-csv-gz-files/m-p/971004#M377230</guid>
      <dc:creator>Season</dc:creator>
      <dc:date>2025-07-17T14:33:57Z</dc:date>
    </item>
    <item>
      <title>Re: Importing .csv.gz files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-csv-gz-files/m-p/971007#M377233</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/437457"&gt;@Season&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;So the selection process still takes place after the entire importation is done, right?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;A text file is linear. There is no way to read it without actually reading it.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jul 2025 14:53:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-csv-gz-files/m-p/971007#M377233</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-07-17T14:53:01Z</dc:date>
    </item>
    <item>
      <title>Re: Importing .csv.gz files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-csv-gz-files/m-p/971010#M377235</link>
      <description>&lt;P&gt;Thank you! I consulted Deepseek on resolving this issue in R and it provided a "flowing decompression" method of dealing with this problem. In short, batches of observations are decompressed, imported, selected and stored. When one cycle finishes, a second batch is decompressed while the first batch of decompressed file is deleted, and so on. The stored observations, which is what we finally want yet is distributed as multiple small datasets for the time being, is stacked to form a large one. Can SAS do something like this?&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jul 2025 15:01:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-csv-gz-files/m-p/971010#M377235</guid>
      <dc:creator>Season</dc:creator>
      <dc:date>2025-07-17T15:01:47Z</dc:date>
    </item>
    <item>
      <title>Re: Importing .csv.gz files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-csv-gz-files/m-p/971012#M377236</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/437457"&gt;@Season&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thank you! I consulted Deepseek on resolving this issue in R and it provided a "flowing decompression" method of dealing with this problem. In short, batches of observations are decompressed, imported, selected and stored. When one cycle finishes, a second batch is decompressed while the first batch of decompressed file is deleted, and so on. The stored observations, which is what we finally want yet is distributed as multiple small datasets for the time being, is stacked to form a large one. Can SAS do something like this?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Why would you want to?&amp;nbsp; SAS does NOT load the whole dataset into memory to work with it, like the original base R does with variables (objects as R calls them).&amp;nbsp; So no tricks to make it use less memory is typically needed when working in SAS.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jul 2025 15:05:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-csv-gz-files/m-p/971012#M377236</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-07-17T15:05:34Z</dc:date>
    </item>
    <item>
      <title>Re: Importing .csv.gz files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-csv-gz-files/m-p/971017#M377240</link>
      <description>&lt;P&gt;Because loading in the entire dataset is too large. I understand that the importation process might not need all of the file to be loaded into memory in SAS, but the question is the resultant imported dataset is too large to be stored in memory as well.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jul 2025 15:33:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-csv-gz-files/m-p/971017#M377240</guid>
      <dc:creator>Season</dc:creator>
      <dc:date>2025-07-17T15:33:11Z</dc:date>
    </item>
    <item>
      <title>Re: Importing .csv.gz files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-csv-gz-files/m-p/971028#M377242</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/437457"&gt;@Season&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Because loading in the entire dataset is too large. I understand that the importation process might not need all of the file to be loaded into memory in SAS, but the question is the resultant imported dataset is too large to be stored in memory as well.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;SAS stores datasets on disk, not in memory.&amp;nbsp; So large amounts of memory are not needed to work with datasets.&amp;nbsp; Especially one that only has 40 variables.&amp;nbsp; The only place you will have memory issues would be if you tried to do analysis that resulted in creating matrices that were too large to store in memory.&amp;nbsp; For example trying to using CLASS variable with millions of distinct classes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Saving such a large dataset on disk might be any issue however.&amp;nbsp; The SAS dataset structure is not that efficient but using the COMPRESS=YES option can make them take a little less disk space.&amp;nbsp;&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;</description>
      <pubDate>Thu, 17 Jul 2025 16:08:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-csv-gz-files/m-p/971028#M377242</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-07-17T16:08:01Z</dc:date>
    </item>
  </channel>
</rss>

