- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Using this paper, "A Quick Guide to the WinZip® Command Line Add-On", I am trying to use the ideas to obtain a listing of the files inside a specific .zip file. I am running SAS 9.3 on Windows 7 Professional (64 bit).
In that paper, on page 6, is the following example:
%wzzip(
zipfile = C:\WZ_Test\Zipped Text Files.zip
,options = -vb >"C:\WZ_Test\ZipInfo.txt"
);
So, I replace the zipfile option with the location of my exact file; and I replace the options= with the location where I want the text file to be, and I run the SAS code. It doesn't work, and I get no error messages in the SASLOG or anywhere else. The desired output file doesn't show up. (Note: in Win 7 64 bit, the WZZIP.exe command is in the location C:\Program Files (x86) instead of C:\Program Files, but I have corrected the code for that).
In the SASlog, there is actual DOS code generated that can be copied and pasted into a DOS window. So, I try that, and the command works in DOS.
So I conclude that there is something in SAS and/or Windows 7 that is preventing the code from executing properly inside SAS. But I have no idea what, or where to look. I welcome your suggestions.
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Your filename has embedded spaces. Try quoting it. (or have the macro do it) The QUOTE function is good for this.
Another issue I have had with other programs is that environment variables are different when run from command shell than when running from within SAS.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Tom wrote:
Your filename has embedded spaces. Try quoting it. (or have the macro do it) The QUOTE function is good for this.
Another issue I have had with other programs is that environment variables are different when run from command shell than when running from within SAS.
My file name does not have space(s) in it, and quoting or not doesn't seem to make a difference.
I don't understand the comment and environment variables, how could I find the environment variables used in the command shell?
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Sure looks like a space between the d and the T and another between the t and the F.
From the command line you might need to enclose that filename in quotes to prevent the parse from thinking it was either multiple files or command parameters.
wzzip -vb "C:\WZ_Test\Zipped Text Files.zip"
Similarly the path the directory with the wzzip executable might have embedded spaces.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Tom, that's the example in the paper with the spaces. Trust me, there are no spaces in my files names.
I will check the environment variables as you suggest.
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
You can use the set command with no arguments to get a list of the environment variables.
One example that I had problems with environment variables was on a Unix system. A program that I wanted to call from within SAS assumed that the environment variable TEMP pointed to a directory where it could store temporary files. But the script that I was using to run SAS had already used that environment variable to point to a file instead of a directory. So I had to include an unset TEMP command in the command string that I called from within SAS to get the program to run properly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Could you use filename + pipe ?