z**********i 发帖数: 12276 | 1 有个dataset:
ID var
001 blood
001 asd
001 sdf
002 blood
002 asd
003 asd
003 all
003 afjl
如何把它们按照ID, output到3个单独的page上。
page1:
001 blood
001 asd
001 sdf
page2:
002 blood
002 asd
page3:
003 asd
003 all
003 afjl
多谢!! |
y******0 发帖数: 401 | 2 I am not sure what you meant.
If you want to output to three different datasets, let the dataset called:
page
data page1 page2 page3;
set page;
if id='001' then output page1;
if id='002' then output page2;
if id='003' then output page3;
run;
Then you can get three datasets.
If you want to print out, you can do like:
proc sort data=page;
by ID;
run;
proc report data=page;
by ID;
column ID var;
define ID/display;
define var/display;
run; |
g*******y 发帖数: 380 | 3 如果是指output window里分页的话,在sas tutorial里找找.
我记得我复习考试的时候在里面看到过. |
g*******y 发帖数: 380 | 4 找到了,不知道是不是你所指的意思.
General form, PAGEBY statement:
PAGEBY BY-variable;
where BY-variable identifies a variable that appears in the BY statement in
the PROC PRINT step. PROC PRINT begins printing a new page if the value of
any of the variables in the BY statement changes.
The variable specified in the PAGEBY statement must also be specified in the
BY statement in the PROC PRINT step. |
z**********i 发帖数: 12276 | 5 为啥看到回帖泥?
【在 z**********i 的大作中提到】 : 有个dataset: : ID var : 001 blood : 001 asd : 001 sdf : 002 blood : 002 asd : 003 asd : 003 all : 003 afjl
|
z**********i 发帖数: 12276 | 6 多谢!!
【在 y******0 的大作中提到】 : I am not sure what you meant. : If you want to output to three different datasets, let the dataset called: : page : data page1 page2 page3; : set page; : if id='001' then output page1; : if id='002' then output page2; : if id='003' then output page3; : run; : Then you can get three datasets.
|
z**********i 发帖数: 12276 | 7 你简直是我的saver.
options nodate;
ods pdf file="D:/dataname.pdf";
*ods pdf StartPage=Never;
Title1 'report';
proc print data=missing;
by id;
pageby id;
run;
ods pdf close;
这样就得到按ID单独分页的pdf文件了。
非常感谢!!
in
the
【在 g*******y 的大作中提到】 : 找到了,不知道是不是你所指的意思. : General form, PAGEBY statement: : PAGEBY BY-variable; : where BY-variable identifies a variable that appears in the BY statement in : the PROC PRINT step. PROC PRINT begins printing a new page if the value of : any of the variables in the BY statement changes. : The variable specified in the PAGEBY statement must also be specified in the : BY statement in the PROC PRINT step.
|