Data Science

How do I efficiently optimize large-scale SAS DATA steps to reduce CPU time and processing costs?

SA Asked by Sarah Miller · 14-03-2023
0 upvotes 12,613 views 0 comments
The question

I am currently working with datasets exceeding 50GB in our SAS environment. My DATA steps are taking hours to execute, which is significantly impacting our server performance. Are there specific techniques like using the KEEP/DROP statements, or perhaps migrating certain logic into PROC SQL, that would provide the best performance boost for high-volume financial data processing? 

3 answers

0
JE
Answered on 16-03-2023

To optimize your SAS environment, you should first focus on reducing the I/O overhead. Using the KEEP and DROP statements at the point of data entry is crucial because it prevents SAS from loading unnecessary variables into the Program Data Vector (PDV). Additionally, consider using the WHERE statement instead of an IF statement to filter observations before they enter the buffer. For datasets this large, look into the COMPRESS=YES option and ensure your lengths are set appropriately. These small changes can reduce execution time by 40% when handling complex financial records.

0
RO
Answered on 17-03-2023

Have you checked if your bottlenecks are caused by network latency or disk I/O, and are you using indexing on the variables you frequently filter by?

RO 18-03-2023

Indexing is a great point, Jennifer! If you are performing multiple joins, creating an index on the join keys can bypass full table scans. However, remember that indexes add overhead during updates. If the data is static, a simple index will drastically speed up your PROC SQL steps or SET statements with WHERE clauses.

0
ST
Answered on 19-03-2023

Try using the BUFSIZE and BUFNO options. Increasing the buffer size allows SAS to read more data in a single I/O operation, which is perfect for 50GB files.

SA 20-03-2023

I totally agree with this approach; buffer management is often overlooked in SAS optimization and makes a huge difference in high-volume environments.

Share your thoughts

Your email address will not be published. Required fields are marked (*)

Professional Counselling Session

Still have questions?
Schedule a free counselling session

Our experts are ready to help you with any questions about courses, admissions, or career paths. Get personalized guidance from industry professionals.

Request a Call Back

Search Online

We Accept

We Accept

Follow Us

"PMI®", "PMBOK®", "PMP®", "CAPM®" and "PMI-ACP®" are registered marks of the Project Management Institute, Inc. | "CSM", "CST" are Registered Trade Marks of The Scrum Alliance, USA. | COBIT® is a trademark of ISACA® registered in the United States and other countries.

Book Free Session