BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ForrestYao
Fluorite | Level 6

Hi there,

 

I have a dataset saved in a permanent library, I want to use proc export to export dataset into an excel file. That excel file is a template so there are some title/date at the very top of the sheet. I want to export my dataset starting row 7 for example. My code looks like:

PROC EXPORT DATA = perm.dataset

dbms=xlsx

outfile= "&libnm./&file." label REPLACE;

sheet="data";

 

RUN;

 

Is there any options in proc export to allow me to do that?

PS: This is an auto-process without any manual work.

Thanks a lot.

 

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User
Try the RANGE option, but you need to include the Sheet name in the RANGE. If you don't know the end of the range just put a 0 to function as a wildcard.

range="Sheet1$A1:0"

I don't know if that's the exact format the range should be in, but hopefully that gives you the idea of what you need to do.

There's also a user custom written macro here that offers more control.
https://communities.sas.com/t5/SAS-Tips-from-the-Community/SAS-Tip-Additional-capabilities-when-expo...

View solution in original post

1 REPLY 1
Reeza
Super User
Try the RANGE option, but you need to include the Sheet name in the RANGE. If you don't know the end of the range just put a 0 to function as a wildcard.

range="Sheet1$A1:0"

I don't know if that's the exact format the range should be in, but hopefully that gives you the idea of what you need to do.

There's also a user custom written macro here that offers more control.
https://communities.sas.com/t5/SAS-Tips-from-the-Community/SAS-Tip-Additional-capabilities-when-expo...

SAS Innovate 2025: Call for Content

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!

Submit your idea!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 594 views
  • 1 like
  • 2 in conversation