Posts Tagged ‘ Reading and Writing Data ’

Read data into vectors or into a matrix: Which is better?

February 8, 2016
By
Read data into vectors or into a matrix: Which is better?

In the SAS/IML language, you can read data from a SAS data set into a set of vectors (each with their own name) or into a single matrix. Beginning programmers might wonder about the advantages of each approach. When should you read data into vectors? When should you read data

The post Read more »

Tags: , ,
Posted in SAS | Comments Off on Read data into vectors or into a matrix: Which is better?

Excluding variables: Read all but one variable into a matrix

September 21, 2015
By
Excluding variables: Read all but one variable into a matrix

Dear Rick, I have a data set with 1,001 numerical variables. One variable is the response, the others are explanatory variable. How can I read the 1,000 explanatory variables into an IML matrix without typing every name? That's a good question. You need to be able to perform two sub-tasks:

The post Read more »

Tags: , ,
Posted in SAS | Comments Off on Excluding variables: Read all but one variable into a matrix

Writing data in chunks: Does the chunk size matter?

March 9, 2015
By

I often blog about the usefulness of vectorization in the SAS/IML language. A one-sentence summary of vectorization is "execute a small number of statements that each analyze a lot of data." In general, for matrix languages (SAS/IML, MATLAB, R, ...) vectorization is more efficient than the alternative, which is to

The post Read more »

Tags: , , ,
Posted in SAS | Comments Off on Writing data in chunks: Does the chunk size matter?

Reading special SAS data sets into matrices

January 28, 2013
By
Reading special SAS data sets into matrices

SAS has several kinds of special data sets whose contents are organized according to certain conventions. These special data sets are marked with the TYPE= data set attribute. For example, the CORR procedure can create a data set with the TYPE=CORR attribute. You can decipher the structure of the data
Read more »

Tags: ,
Posted in SAS | Comments Off on Reading special SAS data sets into matrices

Reading big data in the SAS/IML language

January 21, 2013
By
Reading big data in the SAS/IML language

A SAS/IML user on a discussion forum was trying to read data into a SAS/IML matrix, but the data was so large that it would not fit into memory. (Recall that SAS/IML matrices are kept in RAM.) After a few questions, it turned out that the user was trying to
Read more »

Tags: , ,
Posted in SAS | Comments Off on Reading big data in the SAS/IML language

How to get data values out of ODS graphics

August 1, 2012
By
How to get data values out of ODS graphics

Many SAS procedures can produce ODS statistical graphics as naturally as they produce tables. Did you know that it is possible to obtain the numbers underlying an ODS statistical graph? This post shows how. Suppose that a SAS procedure creates a graph that displays a curve and that you want
Read more »

Tags: , , ,
Posted in SAS | Comments Off on How to get data values out of ODS graphics

Indexing a SAS data set to improve processing categories in SAS/IML

July 16, 2012
By

I have blogged about three different SAS/IML techniques that iterate over categories and process the observations in each category. The three techniques are as follows: Use a WHERE clause on the READ statement to read only the observations in the ith category. This is described in the article "BY-group processing
Read more »

Tags: , ,
Posted in SAS | Comments Off on Indexing a SAS data set to improve processing categories in SAS/IML

How to read data set variables into SAS/IML vectors

May 14, 2012
By
How to read data set variables into SAS/IML vectors

One of the first skills that a beginning SAS/IML programmer learns is how to read data from a SAS data set into SAS/IML vectors. (Alternatively, you can read data into a matrix). The beginner is sometimes confused about the syntax of the READ statement: do you specify the names of
Read more »

Tags: , ,
Posted in SAS | Comments Off on How to read data set variables into SAS/IML vectors

Welcome!

SAS-X.com offers news and tutorials about the various SAS® software packages, contributed by bloggers. You are welcome to subscribe to e-mail updates, or add your SAS-blog to the site.

Proc-x is looking for sponsors!

Dear readers, proc-x is looking for sponsors who would be willing to support the site in exchange for banner ads in the right sidebar of the site. If you are interested, please e-mail me at: tal.galili@gmail.com



SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration.