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
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.