SAS optimization Tips (1) Tracking Resource usage options, controlling memory usage bufsize, BUFNO, Sasfile, ibufsize

Source: Internet
Author: User

CPUTime: The amount of theProcessing Unit (CPU) uses to perform requested tasks such a s calculations, reading and writing data, conditional logic, and iterative logic. CPU time was measured when data must was processed in the program data vector.

I/o:A measurement of the read and write operations that is performed as data and programs are Copied from a storage device to memory (input) or from memory to a storage or display device (output).

1: Use SAS option to track resource usage

You can cancel this option by adding No to the option keyword.

2: Control of memory usage

2.1:measuring I/O

Improvement in I/O can come at the cost of increased memory consumption

With a graph showing the buffer that is the memory of the block and I/o relationship

I/O is calculated from the data set to the buffer and from the buffer to the dataset.

2.1: How can I change the size of a single I/O read-in data?

2.1.1 Page size

In a SAS page size and buffer size is a meaning, then increasing the size will reduce I/O is also a very natural reason, but the cost is memory consumption increased consumption

SAS has a series of algorithms to give a default page size, which is useful for multitasking SAS programs, but it is also possible to manually change the page size.

Generally do not use min, there will be unforeseen problems.

If you copy a dataset using the copy process, the original page size does not persist

2.1.2 Page No

Bufno= control the number of buffers that is available for reading or writing a SAS data set with each I/o t Ransfer

Recommended Use 10

Summary: for small datasets, as much as possible one-time allocations can be sufficient to read the buffer of the data set

3: Using the Sasfile statement

Sasfile statements can hold data sets in memory, reducing open/close operations, including freeing and allocating memory

in data step or proc, SAS will automatically release buffer, in this program if not sasfile,company.sales to be read two times, wasting resources
Sasfile Company.salesLoad;proc PrintData=Company.sales;varCustomer_age_group;run;procTabulate data=Company.sales;class Customer_age_group;varcustomer_birthdate;TableCustomer_age_group,customer_birthdate*(mean median); Run;sasfile company.salesClose;

Summarize

1:if need to repeatedly process a SAS data file that would fit entirely in Memory,use the Sasfile statement to reduce I /O and some CPU usage

2: If You use thesasfile statement and the SAS data file would not fit entirely in memory, the code would EXECU TE, but there might is a degradation in performance

3: If only a part of the file is repeated, it is best to use sasfile, so as to improve efficiency

4: Change the size of the index cache with ibufsize=

This is improved for programs that often use indexing, but to re-index after resizing

Ibufsize=0 reset to system default size

SAS optimization Tips (1) Tracking Resource usage options, controlling memory usage bufsize, BUFNO, Sasfile, ibufsize

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.