In 2002, I started out using BASE SAS 8 and it wasn’t until nearly two years later that I learned how to use SAS Enterprise Guide. It made it so much easier to build charts and just keep my data organized.
The examples given here are very simple because they are intended as a starting point to demonstrate the ease with which the INTO statement can be used.The examples above are an excellent introduction to using SQL to create macro variables, but with some minor changes to example 2, we can show off an additional facet of the INTO statement - the ability to create multiple macro variables at once.Sometimes I’m in the middle of a some code so I don’t want to add another program or maybe I’m just too lazy. In the Filter tab, add the variable you want to view – for instance I needed to know the company names so I added Name as the filter, selected In a List as the filter type and clicked the … This caused the drop-down to appear, where I could click Add Values.Then there is the entire list (click More Values if the list is longer).You don’t have to save the filter – just use it to explore the data. Tricia Aanderud is a SAS Business Intelligence and Visual Analytics consultant based in Raleigh, NC who works for Zencos Consulting.
She has written several books about SAS, presented papers at many SAS conferences, and has been using SAS since 2001. This book provides guidance for getting started with SAS Visual Analytics.
One such operation is performed using the INTO statement.
The INTO statement in PROC SQL is used to put values from datasets into macro variables.
The code below counts the observations in a dataset before taking each value in turn and using it to create a new dataset.
These are just a couple of ways the INTO statement can solve problems that, although solvable in SAS, the solutions are not quite as concise and elegant.
These names are then put into a macro variable using the INTO statement.