BookmarkSubscribeRSS Feed
phadnismukta
Fluorite | Level 6

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;

6 REPLIES 6
Kurt_Bremser
Super User

@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 

Tom
Super User Tom
Super User

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
Fluorite | Level 6
. Zip file was created on server and then simply copied it to another server. The Zip file size is 1.3gb.
Tom
Super User Tom
Super User

@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?

phadnismukta
Fluorite | Level 6
That I will have to check with the person who copied it. Can you please help me understand how the file transfer would affect the zip file. Also, what if the file is transferred to client using sftp?
Tom
Super User Tom
Super User

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.

SAS Innovate 2025: Register Now

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!

Mastering the WHERE Clause in PROC SQL

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.

Discussion stats
  • 6 replies
  • 1362 views
  • 0 likes
  • 3 in conversation