Desktop productivity for business analysts and programmers

Exporting to Windows in AIX environment

Accepted Solution Solved
Reply
Contributor
Posts: 23
Accepted Solution

Exporting to Windows in AIX environment

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


Accepted Solutions
Solution
‎12-17-2014 05:24 PM
Community Manager
Posts: 2,697

Re: Exporting to Windows in AIX environment

John,

If you can make just one change in your PC where you are running SAS Enterprise Guide, you can use the Copy Files custom task.  Usually it does not require administrative privileges to add a custom task for use by the logged-in user.  The "install" involves downloading the task from SAS and dropping it into a local folder in your user profile area.  If you're running SAS Enterprise Guide on Citrix, this can be tricky and you might need IT help.  But for local PCs, it's usually not a problem.

See this blog post for more:

Export and download any file from SAS Enterprise Guide

More about the task:

There and back again: copying files in SAS Enterprise Guide - The SAS Dummy

And an important install note:

Special steps for installing the custom tasks that you download - The SAS Dummy

Chris

View solution in original post


All Replies
Solution
‎12-17-2014 05:24 PM
Community Manager
Posts: 2,697

Re: Exporting to Windows in AIX environment

John,

If you can make just one change in your PC where you are running SAS Enterprise Guide, you can use the Copy Files custom task.  Usually it does not require administrative privileges to add a custom task for use by the logged-in user.  The "install" involves downloading the task from SAS and dropping it into a local folder in your user profile area.  If you're running SAS Enterprise Guide on Citrix, this can be tricky and you might need IT help.  But for local PCs, it's usually not a problem.

See this blog post for more:

Export and download any file from SAS Enterprise Guide

More about the task:

There and back again: copying files in SAS Enterprise Guide - The SAS Dummy

And an important install note:

Special steps for installing the custom tasks that you download - The SAS Dummy

Chris

Contributor
Posts: 23

Re: Exporting to Windows in AIX environment

Chris,

Thank you very much for the suggestion, I will read the links and try the suggestion.  I will post my findings when I am done.

John

Contributor
Posts: 23

Re: Exporting to Windows in AIX environment

Chris,

Thank you so much for your time and posting your exceptionally helpful links.  I suppose my inability to articulate what my issue was exactly into a search engine resulted in my not finding this information on my myriad of searches.  I apologize for having to post a question about something so thoroughly answered already.

Thank you again.  I cannot say that enough.  I cannot express how difficult that barrier has been for me to overcome over the past few years.

With a fully locked down computer due to administrative rights, I was able to put the DLL exactly where you advised to place it. 

Right out of the box it worked, allows for fully dynamic path and file naming, as well as a very quick run time.

John

Community Manager
Posts: 2,697

Re: Exporting to Windows in AIX environment

John, I'm glad this worked for you.  Your success story will help future users who are looking for similar guidance.

Chris

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 492 views
  • 0 likes
  • 2 in conversation