2

いくつかのデータセットを PDF に印刷しようとしています。proc print最初のステートメントを独自のページに残しながら、最後の4つのステートメントを1ページの2 x 2に収める方法を誰か教えてもらえますか?

title;

options nodate nonumber nocenter orientation=portrait spool;

ods pdf file="I:\ASR\201410\bio.pdf" color=yes style=fancyprinter;

ods pdf startpage=NEVER;

ods escapechar='';

ods pdf text='S={just=CENTER preimage="I:/asr/logo.png" posttext=""';

ods pdf text= "S={just=c font_weight=bold font_size=12pt font_face=Arial}Fall 2013 - Annual Statistical Report";

ods pdf text= "S={just=c font_weight=bold font_size=12pt font_face=Arial}Department of Biology";

proc print data=IntApps_AY_cnt_p noobs; TITLE "Applications"; run;

ods pdf startpage=now;

proc print data=enroll_cnts_np noobs; TITLE "New Student Enrollment"; run;

ods pdf startpage=now;

proc print data=enroll_cnts_p noobs; TITLE "Total Enrollment"; run;

ods pdf startpage=now;

proc print data=TuitionScholarships_cnt_p noobs; TITLE "Stipends"; run;

ods pdf startpage=now;

proc print data=asr_degs_cnts_p noobs; TITLE "Academic Year 2012-2013 Awarded Degrees"; run;

ods layout end;

ods all close;

ありがとう

JT

4

2 に答える 2

1

columns=Nのオプションを使用してODS、ページを N 列に分割します。データ セットに合わせて列数を操作してみてください。次に、 と を使用startpage=noして、ステートメントを目的の場所にstartpage=now出力できます。print

SAS は各列を新しいページとして表示するため、これを利用して複数のprintステートメント出力を 1 ページに収めることができます。

2 つの列を使用した例:

options nodate nonumber;
data work.animals;
    input name $ weight;
    datalines;
    monkey 20
    shark 500
    lion 200
    wolf 120
    buffalo 400
    Parrot 10
    Lizard 30
    Human 150
    Whale 1000
    ;
run;

ods pdf file = 'C:\sasdata\animals2.pdf' columns = 2;

ods pdf startpage=no;
proc print data=work.animals; /* This print will be on a seperate page */
    title 'Seperate Paged Animals';
run;
ods pdf startpage=now;
ods pdf text="I want a little paragraph here that explains things about 
columns and startpages for putting this proc print statement on a 
seperate page. The other four statements will be outputed 
onto one page only divided into two columns.";

ods pdf startpage=now;
title;
proc print data=work.animals; /* 2nd print*/
run;

proc print data=work.animals; /*3rd print*/
run;

ods pdf startpage=now;

proc print data=work.animals; /*4th print*/
run;

proc print data=work.animals; /*5th print*/
run;

ods pdf close;
ods listing;

と入力するstartpage=nowと、新しいページではなく、新しい列に移動するだけです。したがって、最初のprintステートメントとテキストの段落は別のページになります。最後の 4 つのprintステートメントは 1 ページになります。

于 2013-12-19T04:56:38.210 に答える
1

ODS LAYOUTこれを達成するために使用する必要があるかもしれないと思います。SAS 9.4 を使用している場合は、学習PROC ODSTABLEまたは他のPROC DOCUMENT関連する手順のいずれかを検討することもできます (詳細については、このドキュメント ページを参照してください)。このODS LAYOUTソリューションは SAS 9.3 以降で機能し、SAS 9.2 でも機能する可能性がありますが、当時は非常にさびていたと思います。

基本的なコードは次のようになります

ods pdf file="c:\temp\blah.pdf";
proc print data=sashelp.class;
run;
ods pdf startpage=now;
ods layout start columns=2;
ods region;
proc print data=sashelp.class;
run;
ods region;
proc print data=sashelp.class;
run;
ods region;
proc print data=sashelp.class;
run;
ods region;
proc print data=sashelp.class;
run;
ods layout end;
ods pdf close;

この方法で 2 つの列を取得します。大きすぎないようにして行を制御する必要があります。ods regionそれが問題になる場合は、ステートメント ( ) で個々の領域の高さ/幅を制御できますが、ods region height=4in一部の SAS 出力のみがスペースに合わせて出力をスケーリングするため、結果に問題が生じる場合と生じない場合があります。

詳細については、You Did That Report in SAS®!?: The Power of the ODS PDF Destination を参照してください。

于 2013-12-19T15:11:05.580 に答える