I have a dataset with a variable that should be numeric, but SAS is reading it as a character variable, and I am having a hard time converting it to numeric. The variable is a YearMonth variable (ie: 2023M01) so I'm wondering if the M in there is causing a problem. I have tried importing the dataset in a proc import and then doing a data step right after to convert from char to num but that doesn't work - it returns "." I have also tried to import the dataset in a proc import and specifying the length of the var, and the informat and format ((YYMM.). That also doesn't work. I really need this variable to be numeric because the remaining code uses this variable for calculations. And I'm frustrated because I can't seem to figure this out. I am attaching some images to go along with I wrote for more clarity.
... View more