SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
paulacalazans
Calcite | Level 5

HI all,

First I downloaded the Gzip:

Gzip for Windows => downloaded: Complete package, except sources


1) In  the command prompt:

                          "C:\Users\sbrpac>"C:\Program Files (x86)\GnuWin32\bin\gzip" -cd "C:\data.csv.gz"

Returned only the first row of the csv only (column names), even though when I open the csv it has more than 1,000 rows.

2) In SAS

                    %let File1="C:\data.csv.gz";

                    %let dir=C:\"Program Files (x86)"\GnuWin32\bin\gzip;

                    Data result_data ;

                         filename file2 pipe %unquote(%str(%'&dir -cd &file1%'));

                        infile file2 dlm="|" LRECL=32767 truncover  dsd firstobs=2;

                        ..... run;

Returned an empty table.

Do you know what might have I done wrong?

1 REPLY 1
ballardw
Super User

Have you tried it without all of the macro variables and quoting functions? As in typing all of the file name without them.

The filename line generated resolves to :


filename file2 pipe 'C:\"Program Files (x86)"\GnuWin32\bin\gzip -cd "C:\data.csv.gz"'

Which has perhaps too many quotes.

You can submit the filename as a separate statement from the data step and see if you get a successful assignment.

sas-innovate-white.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.

 

Early bird rate extended! Save $200 when you sign up by March 31.

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 2038 views
  • 0 likes
  • 2 in conversation