Hello. I would like to be able to cobble together a variable name by using parameters and the "concatenate" operator instead of writing multiple if-then-else statements. For example, the following code block for a calculated item returns the appropriate variable based on the input parameters:
There are many, many combinations of 'ATD Cohort Year' and 'End Term' and I will need to write if-then-else statements for each combination. Instead, I would like to do something like the following code blocks where only one if-then-else statement is required.
This code block returns the string: ATD_201212_201214. This is the name of the column I want to return in my data when someone enters 2012 for cohort year and 201214 for end term.
This code block returns the string: 'ATD_201212_2014'n. I thought that adding the single quotes and the "n" around the column name would make SAS return the column but this didn't work either - it only returns a string.