Thanks for your response! If I understand your code correctly, it essentially passes the parameters by reference so any change to RESULT would be saved, in this call, in V789. Is that right?
Your code may in fact work well, and it seems to me there is no longer a need for the temporary variable. Then I would just have to either delete the RESULT variable or simply not save it with the output data file.
What I don't fully understand is the need for the "!". Wouldn't it also be needed for !RESULT?
Code: Select all
DEFINE CMCode( cMonth = !TOKEN(1)
COMPUTE !result = ((!cYear - 1900) * 12) + !cmonth.
IF (!cYear < 1900 OR !cYear > 2100 OR !cMonth < 1 OR !cMonth > 12) !result = $SYSMIS.
IF missing( !cMonth ) !result = $SYSMIS.
IF missing( !cYear ) !result= $SYSMIS.
CMCode cMonth = V123 cYear = V456 Result=V789.