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?
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.
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.