10-19-2014 08:21 PM
I am trying to create a macro variable that will contain the prior year and same month based on a current date. For example if the current date is 30MAY2014 I wiould like to get 1305. However I keep getting an error with the following
The error I am getting is the following:
ERROR: Required operator not found in expression: putc(5,z2.)
I would really appreciate any suggestions on how I can fix this.
10-20-2014 09:47 AM
But my question would be, why not just use the calculation where you need it, no need to go creating new variables for it?
10-20-2014 10:10 AM
Assigning the value to a macro variable causes the intnx (or whatever method one uses) to be executed only once. Putting it into the later data step causes it to be executed with every iteration. The old-hand programmer in me cringes at that.