SAS ODS输出导出系统



  • /*4 ODS输出传递系统*/
    /*4.1  RTF输出*/
    ods rtf ;
    proc means data=xie.student;
    var math phys chem literat history english;
    run;
    ods rtf close;
    
    /*4.2  HTML输出*/
    ods html  body= 'odshtml_body.htm' ;
    ods html  file= 'odshtml_body.htm' 
    contents='odshtml_contents.htm'
    page='odshtml_page.htm'
    frame='odshtml_frame.htm';
    proc univariate data=xie.student;
    var math phys chem literat history english;
    title;
    run;
    ods html close;
    
    
    Ods html body='E:\SAS培训\bclass.html';
    Proc print data=xie.class label;
    Var  sex age height;
    Run;
    Ods html close;
    
    /*4.3  PDF输出*/
    Ods pdf file='E:\SAS培训\bclass.pdf';
    Proc print data=xie.class label;
    Var  sex age height;
    Run;
    Ods pdf close;
    
    /*4.4  数据文件输出*/
    proc univariate data=xie.student;
    var math phys chem literat history english;
    ods output 	Moments=Moments;
    run;
    
    /*4.5  图形输出*/
    
    
    data Sheets;
    input Distance @@;
    label Distance='Hole Distance in cm';
    datalines;
        9.80 10.20 10.27  9.70  9.76
       10.11 10.24 10.20 10.24  9.63
        9.99  9.78 10.10 10.21 10.00
        9.96  9.79 10.08  9.79 10.06
       10.10  9.95  9.84 10.11  9.93
       10.56 10.47  9.42 10.44 10.16
       10.11 10.36  9.94  9.77  9.36
        9.89  9.62 10.05  9.72  9.82
        9.99 10.16 10.58 10.70  9.54
       10.31 10.07 10.33  9.98 10.15
    ;
    run;
    title 'Normal Probability-Probability Plot for Hole Distance';
    ods graphics on;
    proc univariate data=Sheets noprint;
    ppplot Distance / normal(mu=10 sigma=0.3)
                            square;
    run;
    
    
    data Plates;
    label Gap = 'Plate Gap in cm';
    input Gap @@;
    datalines;
       0.746  0.357  0.376  0.327  0.485 1.741  0.241  0.777  0.768  0.409
       0.252  0.512  0.534  1.656  0.742 0.378  0.714  1.121  0.597  0.231
       0.541  0.805  0.682  0.418  0.506 0.501  0.247  0.922  0.880  0.344
       0.519  1.302  0.275  0.601  0.388 0.450  0.845  0.319  0.486  0.529
       1.547  0.690  0.676  0.314  0.736 0.643  0.483  0.352  0.636  1.080
       ;
    run;
    title 'Distribution of Plate Gaps';
    ods select ParameterEstimates GoodnessOfFit FitQuantiles MyHist;
    proc univariate data=Plates;
    var Gap;
    histogram / midpoints=0.2 to 1.8 by 0.2
                      lognormal
                      weibull
                      gamma
                      vaxis   = axis1
                      name    = 'MyHist';
    inset n mean(5.3) std='Std Dev'(5.3) skewness(5.3)
                 / pos = ne  header = 'Summary Statistics';
    axis1 label=(a=90 r=0);
    run;
    

登录后回复