![]() ![]() To fix that we need to use the vlaue of macro variable whose name is the value of the macro variable NAME. So first you are trying to add one to the string X, which won't work. But if you are trying to create a macro takes as input the Name of a macro variable that you want to increment then you need to change this code becuase it is currently trying to add one to the NAME of the macro variable and store the result back into the macro variable that holds the input to the macro. The %LET statement looks fine if you just wanted to increment a variable named VARTOINCREMENT. Here is your proposed macro definition %macro incrementvar(vartoincrement) ![]() Let's just look at your stated objective of creating a utility macro that will increment a given macro variable by one and ignore the irrelevant data step code as just part of your attempt to debig your problem. ![]() I want to simply increment an integer macro variable whenever I want to, and my macro to do so is expecting an integer? But, i verify in a datastep that my macro variable rank3m_rank (which is being set equal to my macro varible I am trying to increment, &rank3mrankingvar., is indeed a numeric and not a char) There are a couple of other posts I have found, which helped point me towards using %eval in the first place (for example) but were not like my issue and I was unable to apply to my own. Ugh I've been literally beating my head on a wall for a day, it is causing me some serious anxiety. **now lets generate a ranking for everyone, based on their rankin 3 month score ĬharRank3m = put(last.rank3m, 8.) *This is just a test line, to ensure that last.Rank3m is flagging when i expect it is %let vartoincrement = %eval(&vartoincrement. %global nihssbrankvar ninetyrankvar rank3mrankvar ![]() **create an incrementer, so you can rank things, and some macro variables, for rank creation I am trying to increment a macro variable, and keep getting the "A character operand was found in the %eval function or %if condition where numeric expected. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |