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: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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