- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I am using "x tar" to unzip file (PC/WINDOWS). It works but not into the specified directory(e:\outsas), rather
it lands in c:/users/myid. Anyone has idea?
x tar -zxvf e:\20210618.tar.gz index_md_20210618.csv -C e:\outsas;
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
SAS has nothing to do with it, it's a matter of tar usage.
I recommend that you first make sure that tar can be handled properly at the command prompt without using x statement, and then implement it with sas.
I don't know, I haven't tried it, but the -C option of the tar command may not be supported except for the system drive.
In that case, you can use the cd command and execute the following beforehand.
cd /D e:\outsas
So, if you want to write it in one line, it would look like this
cd /D e:\outsas & tar -zxvf e:\20210618.tar.gz index_md_20210618.csv
Give it a try.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
You need to lookup the syntax for tar.
You also need to quote the x command.
You also need to change the title of your post, there's no zip in sight.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
The -z option makes tar filter the archive through gzip first.
It's similar to
gzip -dc file.tar.gz|tar -xvf -
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
SAS has nothing to do with it, it's a matter of tar usage.
I recommend that you first make sure that tar can be handled properly at the command prompt without using x statement, and then implement it with sas.
I don't know, I haven't tried it, but the -C option of the tar command may not be supported except for the system drive.
In that case, you can use the cd command and execute the following beforehand.
cd /D e:\outsas
So, if you want to write it in one line, it would look like this
cd /D e:\outsas & tar -zxvf e:\20210618.tar.gz index_md_20210618.csv
Give it a try.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thanks every one. I tried above at prompt and it works.
- Tags:
- and
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Also tried with SAS. It works. BUT with an issue the prompt stays and SAS chokes up until the prompt exits.
How to exit the prompt automatically?!
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
use noxwait option.
options noxwait;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
You can unzip without the use of X command using this macro: https://core.sasjs.io/mp__unzip_8sas.html