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
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.