Thursday, February 17, 2011

ERROR: No disk space is available for the write operation

While attempting to run a database in excess of 56gb I repeatedly received this error message "ERROR: No disk space is available for the write operation".  When working in SAS all procedures take place wherever the temp folder is located, which is true even if you reference a different library with a libname statement.  The library is the final resting ground for the data, yet all procedures are performed in that temp folder.  The problem I encountered was because my computer's hard drive was ~110 gb and the file was ~56gb.  I have a network folder that is 250gb, but first I needed to figure out how to designate that drive for my SAS temp folder.

I was unable to find a solution online, so I wanted to share my ultimate solution. 

The temp drive and folder I wished to use was "M:\SAS temp"

1.) Locate the config file called "SASV9.CFG"
1a.) My location was "C:\Program Files\SAS\SASFoundation\9.2\nls\en"

2.) Create a back-up config file, just in case.

3.) Open SASV9.CFG
3a.) Under the warning box, about 5 lines down it states
        /*setup the default SAS System user work folder          */
3b.) You will want to change this path to wherever you want your new temp file, so it should read:

/*setup the default SAS System user work folder                 */
-WORK "M:\SAS temp"

4.) Save and close this file

5.) Open sas.exe in "C:\Program Files\SAS\SASFoundation\9.2"


The problem should be solved and all temporary files, including the work library, will now be saved in this location. 

A final note, network drives may run significantly slower.  Therefore, it may be wise to switch back your temp folder once you have completed running this larger file.

Good Luck!

Thursday, January 13, 2011

ODS graphics error

ERROR: Unable to load the Java Virtual Machine
Today I received this error while attempting to execute ODS graphics.  I was using SAS 9.2 on a windows XP platform.  In my prior life with another agency this problem has occurred when I upgraded from 9.1 to 9.2, so this must be a common issue.  Speaking with the local IT help desk and a SAS associate proved useless, yet the problem was solved.

The issue is an incorrect pathway present for your Java Virtual Machine.  You will need admin rights to fix this error, but once you access the files, it is quite easy.

1) Open the folder: C:\Program Files\SAS\SASFoundation\9.2\nls\en
  a) in this folder you will find a file called SASV9.CFG.
  b) make a copy of this folder called something else, i.e. SASv9_backup, just in case.

2) Open the program file containing your java files: C:\Program Files\Java

3) Open the file SASV9.CFG
   a) Scroll down until you hit the line that says:
        -JREOPTIONS=(-Dsas.jre.libjvm=C:\PROGRA~1\Java\JRE15~1.0_1\bin\client\jvm.dll
   b) This is the path SAS is taking to find your version of Java Virtual Machine.
   c) Return to the JAVA folder and check if that pathway exists, it probably won't.
   d) If you have the folder "JRE1.5.0_12" in the java folder then make a simple change to the pathway
   --JREOPTIONS=(-Dsas.jre.libjvm=C:\PROGRA~1\Java\jre15~1.0_1\bin\server\jvm.dll

 4) This is where I got hung up!
   a) Open SAS through the ORIGINAL pathway, not your normal shortcut.  The normal pathway is:
       C:\Program Files\SAS\SASFoundation\9.2\SAS.exe

5) Check to see if the fix worked by running:

%put JREoptions: %sysfunc(getoption(JREOPTIONS));
PROC JavaInfo;

If it runs the procedure with no errors, ODS graphics is ready to execute.


FIX 2.

For the second fix we will adjust the JREOPTIONS in the file SAS utilizes prior to going to the other SASv9.cfg we attempted to change.

1) Open C:\Program Files\SAS\SASFoundation\9.2

2) Locate SASV9.CFG, and make a back up

3) Open this file and under the first command line that states:

-CONFIG "C:\Program Files\SAS\SASFoundation\9.2\nls\en\SASV9.CFG"

Add a second command line:

-JREOPTIONS=(-Dsas.jre.libjvm=C:\PROGRA~1\Java\JRE6\bin\client\jvm.dll -Djava.security.policy=!SASROOT\core\sasmisc\sas.policy -Dsas.ext.config=!SASROOT\core\sasmisc\sas.java.ext.config -Dsas.app.class.path=C:\PROGRA~1\SAS\SASVER~1\9.2\eclipse\plugins\tkjava.jar -DPFS_TEMPLATE=!SASROOT\core\sasmisc\qrpfstpt.xml -Djava.class.path=C:\PROGRA~1\SAS\SASVER~1\9.2\eclipse\plugins\SASLAU~1.JAR -Djava.system.class.loader=com.sas.app.AppClassLoader -Xmx128m -Xms128m -Djava.security.auth.login.config=!SASROOT\core\sasmisc\sas.login.config -Dtkj.app.launch.config=!SASROOT\picklist)

NOTE!  This whole code needs to be in one line.

This fix will work if in the JAVA folder you have the folder "JRE6". 

Run the check on SAS:

%put JREoptions: %sysfunc(getoption(JREOPTIONS));
PROC JavaInfo;

If this PROC runs without an error, ODS graphics is fixed.

 Why this works.

You will notice that the pathway SAS originally uses to identify Java Virtual Machine (Java\JRE15~1.0_1\bin\client\jvm.dll) doesn't exist.  SAS needs to find the program "jvm.dll" and so we must force SAS to find that program.  By fixing the pathway we allow SAS to locate the necessary program to run ODS Graphics, thus solving the problem.

This was a major pain today and just wish to share the fix.