Good afternoon all, Thank you so very much for taking the time to read this whether you can help or not. I appreciate the time and effort involved. I cannot make major changes to our environment as it is a large company and many people use SAS EG (Enterprise Guide) v5.1 with SAS 9.3 behind it. SAS is located on an AIX machine. Shell commands have been disabled within our environment. We do not access to nifty tools like SAMBA. As we are all on Windows XP, I believe this is all 32 bit. That is our setup with all of the pertinent data that I can think of. What I want to do is to export an XLSX file and eventually get it to the Windows networks. I can, within SAS EG, right click on a dataset and choose to export as a step in the program. This allows me to export to either the AIX machine or the Windows locations for the client I am running on. The problem with this is that I cannot change the name of the file to include something dynamic, such as "DAILY_REPORT_YYYYMMDD.xlsx". -->I could do this as a VB Script after the fact, but I would prefer to keep the code all within SAS, allowing me to build dynamic macros to handle this for all of our jobs. Normally, I would just right click on the program that is exporting the data and choose "VIEW LAST SUBMITTED CODE", but this step does not seem to have one available even after running it successfully. Anytime I try to use something like:
PROC EXPORT
DATA=SASHELP.CLASS
OUTFILE="C:\TEST\BOOK1.XLSX"
DBMS=XLSX
REPLACE;
RUN;
It effectively tries to put the file into my home directory on the AIX machine. Example: /home/myid/c:\test\book1.xlsx Obviously this errors out. I have no trouble getting it into my directory on the AIX machine. I have tried a number of things using FILENAME statements (which I can export items from SAS via FILENAME FTP to the Windows drive), but I cannot seem to figure out how to send one filename to another. I tried using PROC COPY for this, but it didn't work. My last thought is to use RSUBMIT to log into the AIX machine and run the FTP command with a batch file to send it, but I hate the idea of my user id and password sitting out completely unsecured on the AIX machine.
PROC EXPORT
DATA=SASHELP.CLASS
OUTFILE="&SYSPARM./BOOK1.XLSX"
DBMS=XLSX
REPLACE;
RUN;
%shared_macro_Using_txpunixA.scr
rsubmit;
x "run my batch ftp job";
endrsubmit;
signoff;
If anyone knows of a way to do this better, please feel free to share. This is something that has plagued me since I began working with our SAS environment three years ago. I am sure I am missing something very simple. Thank you again for reading, thank you for any help you can potentially provide. John
... View more