Desktop productivity for business analysts and programmers

excel export using SAS enterprise guide. Remove timestamp and replace with YYYYDDMM on exported file

Reply
Occasional Contributor
Posts: 17

excel export using SAS enterprise guide. Remove timestamp and replace with YYYYDDMM on exported file

Hi,

 

We run a lot of projects using SAS enterprise guide and export the results in excel using enterprise guide export to excel option (SAS runs in Unix, enterprise guide in windows, file exports in Windows).

 

When exporting, SAS appends the file name with _verXXXXX e.g. "testfile_ver20140328081702.xls" (do not overwrite option checked).

 

Is there anyway to turn this _ver with just e.g "testfile_20140328.xls"? so everytime we export a file, this new file would end up with this DDMMYYYY format even it means to overwrite previously created files.

 

Thanks for your help.

Grand Advisor
Posts: 17,351

Re: excel export using SAS enterprise guide. Remove timestamp and replace with YYYYDDMM on exported

SAS doesn't do that by default AFAIK, though it's possible. Do you have code or a custom task your using? 

Community Manager
Posts: 2,696

Re: excel export using SAS enterprise guide. Remove timestamp and replace with YYYYDDMM on exported

I know what @arunmmw is talking about, @Reeza.  It's a feature in EG that allows you to export an Excel file.  EG writes the Excel file -- not SAS -- in this case.  And the "don't overwrite" option causes EG to append a datetime stamp to generate a unique name.

 

I'm going to assume that you don't have SAS/ACCESS to PC Files available to use PROC EXPORT to XLSX.  But if you have the latest version of SAS 9.4, you could use ODS EXCEL to create the Excel file on Unix directly (no SAS/ACCESS needed).  You can use SAS code to name the file based on the date.  And if you need the file to end up on Windows, you can download using the Copy Files task.  I have the makings of an example in this blog post.

 

 

Occasional Contributor
Posts: 17

Re: excel export using SAS enterprise guide. Remove timestamp and replace with YYYYDDMM on exported

Thanks @Reeza@ChrisHemedinger. Chris, I could create excel files and move them to my unix drive, downloading them into Windows is our challenge. We use enterprise guide excel export option to export files to the required drive for our users to open them directly.

 

Your copy file task is a good solution (probably the only solution) i found. Does your copy file task work with shared drives (not mapped) as well? 

Ask a Question
Discussion stats
  • 3 replies
  • 483 views
  • 4 likes
  • 3 in conversation