I have a %macro that appends the Labels and Formats to my data files - it works flawlessly if I hard-code the file names. I need it to be more dynamic. ** THIS CODE WORKS ** %AppendFormatToCatalog(ct14547_0222_ae_v, ct_ae_v_formats, ct_ae_v_labels);
%AppendFormatToCatalog(ct14547_0222_inf_v, ct_inf_v_formats, ct_inf_v_labels); ... .. * 6 more like these; . ** THIS CODE FAILS ** %let varName = ct14547_0222;
%AppendFormatToCatalog(&varName_ae_v, ct_ae_v_formats, ct_ae_v_labels);
%AppendFormatToCatalog(&varName_inf_v, ct_inf_v_formats, ct_inf_v_labels); ... .. * 6 more like these; . We get new studies every week and the study file formats are exactly the same each week - with a different name. If I choose to hard-code the study name everything works, but the name ct14547_0222 is referenced like 30 times in my script. If I use the "%let varName = ct14547_0222;" bit at the top of my code I can get my script to work *except* for this series of macro calls. How can I get "&varName_ae_v" to resolve to "ct14547_0222_ae_v" in a parameter call so it sends the correct parameter to the macro?
... View more