If the file in a zip archive has a parenthesis, is it possible to unzip using the ZIP engine to the INFILE/FILE statements?
data _null_ ;
infile inzip(one/two/test (2).xpt) lrecl = 256 recfm = F length = length eof = eof unbuf ;
file unzip lrecl = 256 recfm = N ;
input ;
put _infile_ $varying256. length ;
return ;
eof: stop ;
run ;
In LSAF, I get the following messages:
Thank you,
Kevin
Because your file name includes special characters, you must enclose the member name in quotes. This should work:
data _null_ ;
infile inzip("one/two/test(2) .xpt") lrecl = 256 recfm = F length = length eof = eof unbuf ;
file unzip lrecl = 256 recfm = N ;
input ;
put _infile_ $varying256. length ;
return ;
eof: stop ;
run;
Because your file name includes special characters, you must enclose the member name in quotes. This should work:
data _null_ ;
infile inzip("one/two/test(2) .xpt") lrecl = 256 recfm = F length = length eof = eof unbuf ;
file unzip lrecl = 256 recfm = N ;
input ;
put _infile_ $varying256. length ;
return ;
eof: stop ;
run;
Doh!
The syntax is called aggregate syntax:
The solution appears to be use parentheses:
data _null_ ;
infile inzip("one/two/test (2).xpt") lrecl = 256 recfm = F length = length eof = eof unbuf ;
file unzip lrecl = 256 recfm = N ;
input ;
put _infile_ $varying256. length ;
return ;
eof: stop ;
run
Thank you,
Kevin
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.
Ready to level-up your skills? Choose your own adventure.