Hello,
I am zipping the large text file using filename and ODS package. When I am trying to unzip it using unzip command in putty, getting following error
missing 7329002330 bytes in zipfile
attempt to seek before beginning of zipfile
(please check that you have transferred or created the zipfile in the
appropriate BINARY mode and that you have compiled UnZip properly)
I don't have winzip. This file is transferred to the client and they don't use sas
Following code is used to zip the file
filename newfl "&outpath./abc.zip";
data _null_;
if (fexist('newfl')) then
rc = fdelete('newfl');
run;
filename newfl clear;
filename nwzip "&outpath./abc.txt";
ods package(newzip) open nopf;
ods package(newzip) add file=nwzip ;
ods package(newzip) publish archive
properties(
archive_name="abc.zip"
archive_path="&outpath."
);
ods package(newzip) close;
@phadnismukta wrote:
Hello,
I am zipping the large text file using filename and ODS package. When I am trying to unzip it using unzip command in putty, getting following error
missing 7329002330 bytes in zipfile
attempt to seek before beginning of zipfile
(please check that you have transferred or created the zipfile in the
appropriate BINARY mode and that you have compiled UnZip properly)
I don't have winzip. This file is transferred to the client and they don't use sas
Following code is used to zip the file
filename newfl "&outpath./abc.zip";
data _null_;
if (fexist('newfl')) then
rc = fdelete('newfl');
run;
filename newfl clear;
filename nwzip "&outpath./abc.txt";ods package(newzip) open nopf;
ods package(newzip) add file=nwzip ;
ods package(newzip) publish archive
properties(
archive_name="abc.zip"
archive_path="&outpath."
);
ods package(newzip) close;
I see nothing that makes this file a zip file; just naming a file with the .zip extension does not cause it to be a zip file. You should add the zip type to the filename statement, see the documentation: FILENAME Statement: ZIP Access Method
Is your putty connection to the same machine where SAS ran? Or did you move the file? If you moved it how did you move it?
@phadnismukta wrote:
. Zip file was created on server and then simply copied it to another server. The Zip file size is 1.3gb.
To copy from one server to another you have to actually do something. They ran some command. Used some tool. Clicked some button.
So what exactly did they do to move it from server A to server B?
If you move a file with an FTP tool it might consider the file as text and try to "fix" it. On Unix a text file uses linefeed as the end of line marker and on Windows it uses carriage return plus line feed. So when moving from UNIX to Windows it might insert a '0D'x bytes in front of every byte with '0A'x. Some old Windows tools might consider the byte '1A'x as a DOS end of file and stop copying when it sees that byte.
If they moved it with SFTP there is less risk as that moves things as binary.
Why are using ODS PACKAGE to make the zip file instead of just using the ZIP engine? Are you running some really old version of SAS?
Note that if the expanded file is over 2G bytes you might also have trouble if you are using old software that does not support "large" files. Either in creating, moving or expanding the file.
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!
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.