User Tools

Site Tools


lab:projects:13applying_student_t_distribution_on_observed_variables_or_latent_variables:sas_codes_for_dic_analysis
*copy data to the running directory;

%MACRO runsim(i);
data temp;
number = &i;
datastr=put(number, 4.);
datastrcomp=compress(datastr,'');
commd ='cp /pscratch/zzhang4/Private/student-grm/data/TdataLinear/DATAN500I'||datastrcomp||'bugs.txt data.txt';
run;

data _null_;
set temp;
file 'cp.sh';
put commd;
run;

data _null_;
X 'chmod 755 cp.sh';
X './cp.sh';
X 'rm -f cp.sh';
run;
quit;

*copy coda to the results locations;

data temp1;
  r1 = &i;
  rstr=put(r1, 4.);
  codar=compress(rstr,'');
  commd1 = 'mv  codaCODAchain1.txt /pscratch/zzhang4/Private/student-grm/CODA/folder/DATACODANcodansI'||codar||'.txt';
  commd2 = 'mv  out.txt /pscratch/zzhang4/Private/student-grm/CODA/folder/DATACODANcodansI'||codar||'dic.txt';
run;

data _null_;
set temp1;
file 'coda.sh';
put@1 '/pscratch/zzhang4/Private/OpenBUGS307/bin/OpenBUGS.sh < script.txt > out.txt';
put commd1;
put commd2;
put "rm -f data.txt";
put "rm -f codaCODAindex.txt";
put "rm -f cp.sh";
run;

data _null_;
X 'chmod 755 coda.sh';
X './coda.sh';
X 'rm -f coda.sh';
run;
quit;


%MEND runsim;

%MACRO batch;
%LET r=1001;
%DO %WHILE (&r <=1100);
  %runsim(&r);
  %LET r = %eval(&r+1);
%END;
%MEND batch;

%batch;
lab/projects/13applying_student_t_distribution_on_observed_variables_or_latent_variables/sas_codes_for_dic_analysis.txt · Last modified: 2016/01/24 09:48 by 127.0.0.1