Please look at that data step and check for completeness. There is no way you got that output from that data set.
@Ronein wrote:
Hello
I am using proc print with ID+By options.
What is the way that the column titles will appear only one time?
Data have; Input CustID JobCode $ Gender $ Salary; cards; 111 222 333 444 555 666 777 888 999 ; Run; proc print data=have; id jobcode; by jobcode; var gender salary; run;
What type of output are you generating?
Your code runs fine when I run it.
Normal output
Job Code Gender Salary FA1 F 23177 F 22454 M 22268 FA2 F 28888 F 27787 M 28572 FA3 F 32886 F 33419 M 32217
HTML output
Data have;
Input ID JobCode $ Gender $ Salary;
cards;
111 FA1 F 23177
222 FA1 F 22454
333 FA1 M 22268
444 FA2 F 28888
555 FA2 F 27787
666 FA2 M 28572
777 FA3 F 32886
888 FA3 F 33419
999 FA3 M 32217
;
Run;
proc report data=have nowd;
columns JobCode Gender Salary;
define JobCode/order;
define Gender/display;
run;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.