11-20-2015 09:24 AM
I am doing something I do all the time, exporting data sets out to an excel sheet. However, this time I am getting an error that doesn't seem to make sense for what I am doing. The error is as follows:
An error occurred executing the workspace job "programNameHere". The server is disconnected
I've narrowed it down to only getting the error when I try to export specific data sets. The common denominator amongst these data sets is that they are generated from a PROC TRANSPOSE. The other data sets being exported don't cause the error when I run the program with the transposed data sets removed.
It is interesting to note that the log stops recording lines above where the export is taking place AND the rest of the code still seems to execute AND (here's the kicker) the excel sheet is generated and populated correctly. While this still seems to "work," it's messy and I don't want to rely on this shady method for production purposes.
proc transpose data=toBeTransposed out=transposedData; run; PROC EXPORT DATA =transposedData OUTFILE = "filenamehere.xlsx" DBMS = xlsx REPLACE; SHEET = "mySheetName"; RUN;
11-20-2015 09:47 AM
Well, its not really an answer to your question, but me personally I never use proc export. Why not use excelxp tagset and proc report, far more control, and formatting options. If you need a "real" xlsx file, then libname excel? If you need a plain file with just the data, then CSV would be the option. For strcutured data then use XML.
11-20-2015 10:14 AM - edited 11-20-2015 10:15 AM
I'm not familiar with those methods you've mentioned. Do you think you could point me in the direction of some tutorial? Or even a snippet of clear cut code that would do the basic function of dumping data to an excel sheet? (I'll do a bit of googling as well!)
I could do the csv, but I don't think that supports multiple tabs as it isn't really an excel file.
11-20-2015 10:23 AM
With regards to the CSV, it depends on what you are doing. If the information is for review, then I would suggest PDF/RTF as a preferred medium. If the data is for transfer, then CSV or XML would be preferred formats.
11-20-2015 11:05 AM
How big are the transposed data sets? Have you possibly exceeded the number or columns or rows? I believe there may be a limit , maybe 255, on the number of variables the export engine handles for XLSX in some implementations.
11-23-2015 08:57 AM
What are the column names? I had trouble with XLSX in an earlier release when the column names looked too much like Excel's notation of cell references. 'A1' for example.
11-23-2015 09:01 AM