Hi,
Would like to know how to customize my report1 in PROC REPORT to look as report2?
That is what I have now: Report1
column1_____column2_____
AAAA_______C1_________
AAAA_______C2_________
AAAA_______C3_________
BBBB_______D1_________
BBBB_______D2_________
That is what I want to have: Report2
column1_____column2_____
AAAA_______C1_________
AAAA_______C2_________
AAAA_______C3_________
column1_____column2_____
BBBB_______D1_________
BBBB_______D2_________
I need to repeat a header before each section which group by column1.
Thanks!
With nothing to work with I can't provide code, at a guess I would say set the options to be break on nothing - How you do this depends on the output type. Also set:
options nobyline;
Then do your proc report with:
by column1;
This will print each by group, with headers one after the other, again depending on output type.
When posting a question its very important to tell us some information about the question as we can't see your machine. Show your code, present some test data in the form of a datastep or use the sashelp library datasets to show what you mean.
This is my code:
data person;
input column1 $1-4 column2 $6-7;
datalines;
AAAA C1
AAAA C2
AAAA C3
BBBB D1
BBBB D2
;
proc report data=work.PERSON;
column column1column2;
define column1 /group order=internal;
define column2 /display;
run;
Unfortunately, your decision makes two tables instead of one:
My goal is:
Well, two tables is effectively what your asking for, a table is defined as one row for headers, then a row for each data item. In the given case, can you not shrink the gap between the two, margins and such like.
@Ksharp has a nice suggestion with putting a row out per by group rather than breaking the table.
proc report data=sashelp.class nowd noheader;
column sex name age;
define sex/group;
define name /display;
define age/display;
compute before sex;
line @1 'Sex' @6 'Name' @14 'Age';
endcomp;
run;
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.