Posts Tagged ‘ Macro Programming ’

How to split one data set into many

January 26, 2015
By
How to split one data set into many

Back in the day when the prison system forced inmates to perform "hard labor", folks would say (of someone in prison): "He's busy making little ones out of big ones." This evokes the cliché image of inmates who are chained together, forced to swing a chisel to break large rocks

The post Read more »

Tags: , , , ,
Posted in SAS | Comments Off

Put them back the way you found them: restoring SAS titles

October 1, 2013
By

Has this ever happened to you? You have a SAS program with statements that you wrote, then you make use of a macro function or %include file supplied by a helpful colleague, and when your SAS code resumes, you find that all of your SAS titles have been changed out
Read more »

Tags: , , ,
Posted in SAS | Comments Off

Copy a file using a SAS program: another method

September 18, 2013
By

A couple of years ago I shared a method for copying any file within a SAS program. It was a simple approach, copying the file byte-by-byte from one fileref (SAS file reference) to another. My colleague Bruno Müller, a SAS trainer in Switzerland, has since provided a much more robust
Read more »

Tags: , , , , ,
Posted in SAS | Comments Off

How to find the ENGINE name for a SAS library

June 4, 2013
By

One of the great things about SAS libraries is that you can write your programs to read and write data without having to worry about where the data lives. SAS data set on a file system? Oracle table in a database server? Hadoop data in Hive? For many SAS applications,
Read more »

Tags: , , , ,
Posted in SAS | Comments Off

An FTP-style task in SAS Enterprise Guide: user-driven fixes

May 16, 2013
By
An FTP-style task in SAS Enterprise Guide: user-driven fixes

A few months ago I released the Copy Files task for use with SAS Enterprise Guide. The task allows you to transfer any files between your PC and a SAS Workspace session, much like an FTP process. It doesn't rely on FTP though; it uses a combination of SAS code,
Read more »

Tags: , , , ,
Posted in SAS | Comments Off

Improving on a SAS programming pattern

March 23, 2012
By
Improving on a SAS programming pattern

Earlier this week I described a common programming pattern in the SAS macro language. The pattern sets up a loop for processing each distinct value of a classification variable. The program uses the PROC SQL SELECT INTO feature to populate SAS macro variables. The effect: you can roll your own
Read more »

Tags: , , , ,
Posted in SAS | Comments Off

Implement BY processing for your entire SAS program

March 20, 2012
By
Implement BY processing for your entire SAS program

Most SAS procedures support the BY statement, which allows you to create a report or analysis for each distinct value of a variable in your data set. The syntax is simple, and SAS procedures are usually tuned to do a good job of processing the data efficiently. However, the BY
Read more »

Tags: , , , , ,
Posted in SAS | Comments Off

How many observations were processed by that last step?

March 15, 2012
By

A well-formed WHERE statement or subsetting IF can narrow down the output of your SAS DATA step. The SAS log does a good job of telling you how many records were processed by the action. For example, let's look at this simple DATA step with my "poor man's random sample",
Read more »

Tags: , , ,
Posted in SAS | Comments Off

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

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.

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.