/* Enable the ODS MARKUP destination */
ods markup file="example.xlsx" style=sasweb;
/* Your SAS code here */
data example;
input Name $ Age Height Weight;
datalines;
John 25 175 70
Mary 30 160 55
Bob 28 180 80
;
/* First PROC REPORT */
ods text=" "; /* Insert a page break before the first PROC REPORT */
proc report data=example nowd;
/* Define your first report here */
column Name Age Height Weight;
define Name / display;
define Age / display;
define Height / display;
define Weight / display;
run;
/* Insert another page break between reports */
ods text=" "; /* Insert a page break before the second PROC REPORT */
/* Second PROC REPORT */
proc report data=example nowd;
/* Define your second report here */
column Name Age Height;
define Name / display;
define Age / display;
define Height / display;
run;
/* Disable the ODS MARKUP destination */
ods markup close;
ods text=" "; code Creating the box . i need to one proc report one page and second proc report on second page
Why ODS MARKUP?
ODS Excel by default will put each table of output on a separate sheet.
Also, ODS MARKUP when you don't provide a TAGSET name generates stuff that is not actually XLSX and can cause issues with programs attempting to open the file complaining that the source is not proper.
You should get in the habit of always including a full path, such as starting at a drive letter, drive mount point or network share for file names such as file= "C:\users\john\mydatafolder\example.xlsx". Otherwise you may spend a lot time trying to find where that file was written or get to troubleshoot errors where the file tries to write to a location that you don't have permissions.
Catch the best of SAS Innovate 2025 — anytime, anywhere. Stream powerful keynotes, real-world demos, and game-changing insights from the world’s leading data and AI minds.
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.