01-29-2015 04:01 PM
I have a project containing about 15 process flows, each resulting in a subsequent custom report. Each custom report is set up to automatically export via EG as a PDF to a folder. Overnight, a scheduled task runs this project, but the PDF reports do not seem to update and the size of each PDF is 0 KB. When I manually export the PDF via the EG project they sometimes refresh with some showing 0 KB and others showing the actually file size (meaning they exported correctly).
No errors in SAS are generated. What would cause such an issue?
EG 6.1 64-bit
Windows 7 64-bit
Adobe Reader XI
01-29-2015 04:19 PM
Are you overwriting the PDF files or creating new ones?
I had this issue in BASE SAS and it was because I was overwriting the files and it didn't like to do that in a batch process mode, I had to make sure the files didn't exist prior to exporting them. If I was running it interactively it was fine. Took me a while to debug that one.
01-29-2015 04:23 PM
I am actually trying to overwrite the file, so it seems I am having the same issue that you were. How does one make this work without having an absurd number of PDF documents from not overwriting the old output?
Thank you for your insightful response, it seems that shouldn't be an issue with EG. We need a hot fix!
01-29-2015 04:32 PM
I would contact tech support and see what they say. Or wait to see what others say, there are some power EG users on here who may have a better response.
In my case, it was only a "one time" process but for many iterations so I didn't need to keep files around. Otherwise you can use an OS script to clean up the files. I'm not sure it's an EG issue but perhaps an OS or PDF issue.
01-29-2015 04:42 PM
I am merely exporting from the SAS report builder so there really isn't much coding involved in this instance. I had to use the report builder since I have multiple tables and graphs I want to present on one PDF page. Is there a way to incorporate this function within my project?
01-29-2015 04:52 PM
Without looking into the details of your project, there really isn't much specific I can say. Here is what I would do in general:
1. Locate the element where you output/update the PDF report, and create and insert a new 'program' element right before it. The new program is where you can clean up the legacy PDFs.
2. Or convert the whole project into SAS code, and locate the same part mentioned in (1), then insert the 'clean up' code right before it.
01-29-2015 05:48 PM
I took your #1 advice and created a program to go into the folder and delete the old documents using this code:
FILENAME MyFile "C:\OutputFiles\File01.xls" ;
DATA _NULL_ ;
rc = FDELETE('MyFilel ') ;
FILENAME MyFile CLEAR ;
It performed the task perfectly (thank you for the advice), but the new file still reads 0 KB in size and does not properly open in Adobe Reader. It isn't overwriting anything at this point so I am at a loss.
01-30-2015 09:03 AM
You caught me SASKiwi lol, I actually did replace the .xls with .pdf, I promise!
Reeze, same thing here. I deleted the '1' from myfile.
I feel like we've gotten off track .
01-30-2015 11:57 AM
I set up a looping delete all command to first delete the existing files in the folder, and then turned off (unchecked the box) the overwrite existing output option.
filename filrf "&path.";
did = dopen('filrf');
memcount = dnum(did);
do while (memcount>0);
fname = dread(did,memcount);
if scan(lowcase(fname),2,'.')='pdf' then do;
rcref = filename('fref',catx('\',"&path.",fname));
rcdel = fdelete('fref');
This seemed to work with all of the pdf documents showing up with full content. I will have to watch it going forward to see if it actually does successfully continue.