2013-12-19 2 views
2

일부 데이터 세트를 PDF로 인쇄하려고합니다. 아무도 나에게 내가 마지막 페이지를 맞출 수있는 방법을 말해 줄 수 있습니까? proc print 진술을 하나의 페이지에 2 x 2로 가져 가면서 처음 페이지를 남겨 두는 것입니다.sas ods columns - "저널 스타일"문서 만들기

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

+0

2 x 2 크기의 측정 값은 무엇입니까? –

+0

페이지에있는 한 구체적인 것은 없습니다. 인쇄 된 이러한 데이터 세트는 그 크기가 클 수 없으며 일부 텍스트도 함께 포함하고자합니다. – user1624577

답변

1

사용 N 열로 페이지를 분할하는 ODS에서 columns=N 옵션을 선택합니다. 데이터 세트에 맞게 열 수를 조작하십시오. 그런 다음 startpage=nostartpage=now을 사용하여 원하는 위치에 print 문을 출력하십시오.

SAS는 각 열을 새 페이지로 간주하므로 여러 print 문 출력을 한 페이지에 맞출 수 있습니다. 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 문과 텍스트 단락은 별도의 페이지에 있습니다. 마지막 네 개의 print 문은 한 페이지에 있습니다.

+0

첫 번째 페이지가 단 하나의 열이지만 추가 페이지가 두 개의 열이되도록 만드는 방법이 있습니까? 그것은 보인다 : ods pdf file = 'C : \ sasdata \ animals2.pdf'columns = 2; 은 두 번째 페이지가 아닌 전체 문서에 적용됩니다. 일부 ODS 지역 자료를 살펴 봤지만 실제로 따르지 않고 예상 한 결과를 얻지 못하고 있습니다. – user1624577

+0

@ user1624577 열을 사용하지 않고 다른 이름을 가진 별도의 pdf 파일에 첫 번째 print 문을 출력 할 수 있습니다 (즉, 다른'ods pdf file ='). 그리고 나서 두 개의 pdf 파일을 다음을 사용하여 온라인으로 병합하십시오. http://foxyutils.com/mergepdf/ (나중에 파일을 다운로드 할 수 있습니다) –

+0

@ user1624577 pdfs의 병합이 작동 했습니까? 아니면 여전히 몇 가지 문제가 있습니까? 건배. –

1

이 작업을 수행하려면 ODS LAYOUT을 사용해야 할 수도 있습니다. SAS 9.4가있는 경우 PROC ODSTABLE 또는 다른 PROC DOCUMENT 관련 procs 중 하나를 학습하는 것도 고려할 수 있습니다 (자세한 내용은 this doc page 참조). ODS LAYOUT 솔루션은 SAS 9.3+에서 작동하며 SAS 9.2에서도 작동 할 수 있습니다. 그러나 당시에는 매우 녹슨 것으로 생각됩니다.

기본 코드는 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; 

같은 것입니다. 너무 크지 않도록 행을 제어해야합니다. 이것이 문제인 경우 ods region 문 (ods region height=4in)에서 개별 영역의 높이/너비를 제어 할 수 있지만 일부 SAS 출력 만 출력에 맞게 조정되므로 결과에 문제가 발생할 수도 있고 그렇지 않을 수도 있습니다. 공간.

자세한 내용은 You Did That Report in SAS®!?: The Power of the ODS PDF Destination에서 찾을 수 있습니다.