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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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