Ask Your Question
1

What is the method to iterate through table records using SAS?

asked 2022-06-25 11:00:00 +0000

devzero gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2021-12-23 16:00:00 +0000

djk gravatar image

In SAS, the most common method to iterate through table records is by using a data step.

Here is an example code:

data new_data;
  set old_data;
  /* iterate through each record */
  /* add your code here */
run;

In this code, old_data is the name of the table you want to iterate through, and new_data is the name of the new table you want to create.

The set statement reads in each record from old_data, and the iteration occurs for each record. You can add your own code to manipulate the data or perform calculations.

Once the iteration is complete, the updated data is saved to new_data.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2022-06-25 11:00:00 +0000

Seen: 10 times

Last updated: Dec 23 '21