Hi All,
I am trying to zip a csv file using x command, we have around 10 reports generated using a SAS program and the x command is working for all the 9 reports but it is not working for one of the reports generated. I have cheked the permissions on the folder and the file, and the permissons on the .csv file and the folder is 777.
Kindly suggest what am i missing i m using the below code to zip the file once it is created using proc export.
x zip /shared/Santosh/annual/publisher_id/ALL_Business_&today.
/shared/Santosh/annual/publisher_id/ALL_Business_&today..csv;
Regards
Santosh...
When you use an X command you are asking the operating system to run a program. I suspect that if you have a compression program that it is named something other than Zip. You may also need to provide the path to the executeable depending on your configuration.
To test the first open a command prompt and type Zip and see what happens. If you get a message similar to 'zip' is not redognized as an internal or external command, operable program or batch file then you do not have a program named zip and should look for the name of any compression program you may have installed.
Since you did not post any error or other message, I guess you do not get one.
Use the following method to catch messages returned by system commands:
filename oscmd pipe "command you want to run 2>&1";
data _null_;
infile oscmd;
input;
put _infile_;
run;
The 2>&1 reroutes stderr (standard error) output to standard output, so you get it in your data step.
After running your command like this, any messages that are returned by the system will appear in the SAS log.
Once you have them, and they don't provide a clue to you, post them here.
If you use a pipe instead of the X command then you can examine any error messages the operating system is trying to send you and that should help you to debug your problem.
data _null_;
infile "zip /shared/Santosh/annual/publisher_id/ALL_Business_&today.
/shared/Santosh/annual/publisher_id/ALL_Business_&today..csv"
pipe;
input;
put _infile_;
run;
Hi Tom.
Thank you for your quick response,
I tried pipe to see what is going on, i got the below eror message:
zip warning: name not matched:
zip error: Nothing to do!
i checked the file exists at the location and name of the file is also same.
Could you help me on this?
Regards,
Santosh
Do a google search for
zip warning: name not matched:
and follow the links (the stackoverflow ones look quite promising to me), you might get a hint that fits your situation.
Check your case. The operation may he CASE sensitive.
Hi Reeza,
Thank you !!!
I have checked the Case as well, and both file names and the Case is matching.
Kindly suggest me on this.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.