Home / file parsed but not updating / Updating a variable in sas

Updating a variable in sas

These names are then put into a macro variable using the INTO statement.

This macro variable is then used as the criteria to make an extraction from another dataset.

Assemble the filter as you like, then click the Update button. This can be handy when your coded filter is failing and you need to understand why.

If the Update button is not there, select the Show Preview button, which changes to Hide Preview when the Update pane is showing.

Some people don’t realize they can view the dataset in the metadata – just like you can in BASE SAS.

All you have to do it double-click and dataset is added to the Project Tree. [Not too long I discussed datasets and metadata libraries.] You can use PROC FREQ to see all values for a variable but that involves typing.

Then on the second run through the loop, with &i = 2, it will pull out the name "Peter" again and recreate the exact same dataset.

updating a variable in sas-17updating a variable in sas-34

Today I just want to share some quick tips that I use SAS Enterprise Guide to review my data quickly.

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).

Let's take a slightly different situation, where we only have the 'likes' dataset and we want to create subsets for all the names contained in it.

This is straightforward enough to begin with - we simply run our Proc SQL steps on the 'likes' dataset, rather than the 'name_list' dataset, and everything else follows through as before.


  1. Initially the macro variable &choice is set to NO Refer to Appendix. Because there will be continuous updates and changes in production programs included in.

Leave a Reply

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