BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
sakuraiiko
Calcite | Level 5

I have been having a few problems with my code and while I finally corrected one problem, it seems to have created another one. Background: my coworker is out on leave, and I have inherited some of his code. The original problem was: when my coworker ran a job in his crontab or when I ran it manually, it worked fine when the zip command just had the filename. But when I run it through MY crontab, after it created an excel file it would fail when trying to email the zip because no zip was created. Once I changed the code to have the full path and not just the filename it is emailing the zip successfully, but it causes my zip file to be full of folders of the full path. I.E. path is /proj/team/MIS/Daily/job1 and when I get the email and open the zip file it opens a proj folder, inside that is a team folder, inside that is a MIS folder...etc until it finally gets to the xls. I just want the xls to be in the zip, no folders.

Here is the code I am using to create the zip.

DATA _NULL_;

  CALL SYMPUT("sysdate2",PUT(TODAY(),YYMMDDn8.));

RUN;

DATA _NULL_;

  CALL SYSTEM("/usr/bin/zip -9 /proj/team/MIS/Daily/job1/job1_&sysdate2 /proj/team/MIS/Daily/job1/job1_&sysdate2..xls");

  X=SLEEP(5,1);

RUN;

Does anyone know how I can fix this?

1 ACCEPTED SOLUTION

Accepted Solutions
Patrick
Opal | Level 21

I believe this is just about adding a switch to your zip command so that the folder structure doesn't get included. You will need to consult the man pages for your zip implementation to determine the correct syntax (it could be -j: "/usr/bin/zip -9 -j /proj/team......)

View solution in original post

1 REPLY 1
Patrick
Opal | Level 21

I believe this is just about adding a switch to your zip command so that the folder structure doesn't get included. You will need to consult the man pages for your zip implementation to determine the correct syntax (it could be -j: "/usr/bin/zip -9 -j /proj/team......)

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 664 views
  • 0 likes
  • 2 in conversation