07-03-2016 04:02 PM
I am currently remoting into my university's server to run SAS on the UNIX server through batch mode. I am running a simulation study and am at the part where I am analyzing my data and would like to output the analyses as a separate data set. However, when I try and do so, the output data sets are not being created. Any ideas as to what is going on? Any help is much appreciated. Below is the code I have used:
*fitting a misinformed multilevel model to the 4 time point data and assuming a normal response*; *specifying a library for the ods output to go to*; libname output '/home/users/txbanh.AD3/output'; *importing the simulated data set*; proc import datafile = "Four_Normal.csv" out = Four_Normal dbms = csv; getnames = YES; run; *starting the macro to analyze the data*; %macro MCMC; %let Size_List = 5|10|15|20|25|30|35|40|45|50|60|70|80|90|100; %let num_Size = %eval(%sysfunc(count(&Size_list,|))+1); %do i = 1 %to &num_Size; %let Size = %scan(&Size_list.,&i,|); %let v = %eval(&Size-2); proc mcmc data = Four_Normal nmc = 50000 thin = 5; by Iter; where Size = &Size; *here is where I specify the ods output. I am trying to create ods output for each sample size and then I concatenate them all at the end*; ods output PostSummaries = output.PostSummaries_&Size PostIntervals = output.PostIntervals_&Size;
07-03-2016 04:25 PM
I don't see anything wrong with the code you've posted so your issue is somewhere else.
Check your log, if you can't see it, post the log.
Use the following to see what macro variables resolve to in your log and code generated:
options mprint symbolgen;
07-03-2016 06:44 PM
When I run the program, the code stops at this warning message:
WARNING: Output 'PostIntervals' was not created. Make sure that the output object name, label, or path is spelled correctly. Also, verify that the appropriate procedure options are used to produce the requested output object. For example, verify that the NOPRINT option is not used.
WARNING: Output 'PostSummaries' was not created. Make sure that the output object name, label, or path is spelled corr
ectly. Also, verify that the appropriate procedure options are used to produce the requested output object. For example, verify that the NOPRINT option is not used.
This is a standard message when the output isn't being created and doesn't really give me any insight as to the problem at hand. Any ideas what's going on?
07-03-2016 07:01 PM
Check your SAS version is the same between the two versions.
Assuming exact same SAS versions and same input data that shouldn't happen, so one must be different.
That error is generated when your proc doesn't generate the table for some reason. Some defaults may change between versions which is why what version you're running is important.
07-03-2016 07:26 PM
When I look in the doc for PROC MCMC, I do see the PostSummaries output object and I see the PostIntervals output object, but I also see that you need to specify the STATISTICS=Interval option in the MCMC code:
http://support.sas.com/documentation/cdl/en/statug/68162/HTML/default/viewer.htm#statug_mcmc_details... and if you research further in the doc, it says:
=== === ===
The "Posterior Intervals" table (ODS table name PostIntervals) contains the equal-tail and highest posterior density (HPD) interval estimates for each parameter. The default $\alpha $ value is 0.05, and you can change it to other levels by using the STATISTICS= option. The table is not displayed by default and can be requested by specifying the option STATISTICS=INTERVAL .
=== === ===
I do NOT see the STATISTICS=INTERVAL option in your code. Here's the doc on that:
07-03-2016 08:10 PM
The defaults do appear to have changed between versions. For 9.2/9.3 those tables are produced by default.
According to @Cynthia_sas they're not in SAS/Stat 14.1
My guess is this is your issue in testing versus running via batch - diff versions of SAS or SAS/Stat at the least.
07-04-2016 02:15 AM - edited 07-04-2016 02:19 AM
In more basic terms, is ODS OUTPUT via a LIBNAME reference a valid UNIX directory location for your ODS results files?
For example, if my customers forget to include FILE= or BODY= the ODS output files end up being written to the current UNIX directory that existed when $SASROOT/sas was executed.
Sometimes from EG this end up being config/Lev1/SASApp, which they don't have write access to, and therefore get an error.
07-04-2016 10:04 AM
The output from the ODS OUTPUT statement is a SAS dataset which can be written to WORK or to a permanent library location. ODS OUTPUT does not use a FILE= or BODY= named file. ODS OUTPUT works the same way for UNIVARIATE as for PROC MCMC. Here's some sample code that creates an output dataset using the WORK libref and then a permanent LIBREF. You will have to change the code to make PERM point to a location where you have WRITE access.
ods output basicmeasures=work.bsc_meas; proc univariate data=sashelp.class; var height; run; proc print data=work.bsc_meas; title 'from univariate basic measures'; run; libname perm '<your location>'; ods output testsforlocation=perm.tfloc; proc univariate data=sashelp.class; var age; run; proc print data=perm.tfloc; title 'from univariate perm.tfloc'; run;