[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Storing multiple values in a macro

From   Malcolm Wardlaw <>
Subject   st: Storing multiple values in a macro
Date   Sun, 02 Mar 2008 19:16:25 -0600

I have a two part question.

The first is, I'm wondering how to store multiple numerical values in a macro. I know how to do it with string variables, but I'm stuck on numbers.

The second is a more general question on a routine I'm trying to run. I've constructed a way to do it, but I think it must be terribly inefficient.

What I'm trying to do is to merge observations based on a range instead of a single value. The match is one-to-one, but it involves trying to match a single date in between a start and end date in another data set. What I did was to loop through each observation in the original data set, store the values in a macro, and then `use' only the single observation that corresponds to being greater than the first date and less then the second. I then tag that observation with a code and append it to a new data set. This gives me a coded merge-able dataset.

It seems terribly inefficient though. I have to load one dataset, clear it, load another, and then save the results to a third dataset for each observation.

Any ideas?
* For searches and help try:

© Copyright 1996–2019 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index