BookmarkSubscribeRSS Feed
kiranv_
Rhodochrosite | Level 12

Hi all,


I have created a .txt file and did .gz . After that used filename ftp statement
ftp was succesfull. but  I am not able to unzip on other server. Please help

 

Thanks

Kiran

14 REPLIES 14
Reeza
Super User

This doesn't really sound like a SAS issue...where is SAS coming in to play?

kiranv_
Rhodochrosite | Level 12

I agree.  did anyone of had same problem, please suggest

Reeza
Super User

Then again it really doesn't sound like a SAS issue. Even if you use SAS for FTP it's likely using an external app via a system command. 

 

Whats the error unzipping?

kiranv_
Rhodochrosite | Level 12

I agree. no error and file does not gets unzipped.

Reeza
Super User

In these situations you need to get your system commands correct and then use SAS to execute them. That first step is vital. 

Tim_SAS
Barite | Level 11

Make sure you use a binary mode ftp. If you use text mode it will corrupt the zip file.

kiranv_
Rhodochrosite | Level 12

Thanks. it is alreasy in binary mode.

Reeza
Super User

Please post your code.

 

Have you confirmed that it works via system commands?
Your server also has gzip? SAS doesn't provide a zip utility. If you use winzip you don't need to unzip the file...

kiranv_
Rhodochrosite | Level 12

This is for my colleague and he is trying the system commands. Our system has gzip.

ballardw
Super User

You'll likely be better off unzipping the file after ftp to local computer and then read the results. If you do not have WINZIP then reading the zipped file will fail as far as I know.

kiranv_
Rhodochrosite | Level 12

he used below link 

http://support.sas.com/kb/25/211.html

 

Reeza
Super User

That's nice. It still doesn't help illustrate what code he actually used.

 

And again, those are system commands. Verify your system commands first, then pass them to SAS. 

Patrick
Opal | Level 21

So from what you tell us:

1. zipping in the source system works

2. sending the zipped file via FTP works and the target system receives the zipped file

3. unzipping in the target environment doesn't work.

 

What you need to do is a bit of an analytical approach to get to the point where something goes wrong.

 

Questions:

a. once you've zipped your file in the source environment: can you unzip it again in the source environment?

b. have you tried to simply ftp the file via command prompt ftp commands (without any SAS involved)? 

c. WHAT does not work for unzipping? There is no tool available to do the job? Or you get an error message when trying to unzip? Or you can unzip but then the content is "garbled"?

d. What's the source OS (Unix, Windows, ...) and what's the target OS?

e. Which tool/software are you using in the target environment for unzipping? If you can try 7-zip as it deals with quite a number of different archive formats. 

kiranv_
Rhodochrosite | Level 12

Hi All,

 

Thanks for all your replies. My colleague found a custom macro which was built by one of the team member and that has worked for him.

 

Thanks

 

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 14 replies
  • 1892 views
  • 2 likes
  • 5 in conversation