Tip of the Day
sasCommunity Tip of the Day
If you are a beginner like me and have to work with Excel files, this should help you.
Scenario: Suppose you have an Excel file named abc.xlsx that has multiple sheets and let xyz be one of those sheets. Further suppose that within that sheet you want to extract data from the region B4:H200 and create a sas data set. This is how you can accomplish this.
PROC SQL; CONNECT TO EXCEL (PATH="L:\Raghu\Desktop\Code\abc.xlsx"); CREATE TABLE SasDataset AS SELECT * FROM CONNECTION TO EXCEL (SELECT * FROM [xyz$B4:H200]); DISCONNECT FROM EXCEL; QUIT;
Note: The code uses column values from the first row to create variable names.
Feel free to comment on this tip.
Tips Index by Status
The Tip of the Day Project
A new technical Tip of the Day related to SAS software will be shown on this page and the sasCommunity.org main page every day. Before getting started, you can Browse and Search the current list of tips contributed by users.
Anyone can participate. We hope you do! Here's how:
- Submit a Tip by posting a SAS tip that you think others might find useful
- Review a Tip prior to publishing