First thing: Read your log. That will tell part of what is going on.
I bet that you have at least one error with that code. When you post a question about something not working and your log shows errors or messages you do not understand the copy the entire data step or procedure code from the log and on the forum open a text box with the </> icon above the message window and paste the text there.
I think this may be closer to what you attempted:
DATA H_TEMP_RECORD2;
SET H_TEMP_RECORD;;
ARRAY VARS {*} _NUMERIC_;
DO i=1 to dim(vars);
IF VARS(i)>40 THEN VARS(i)=.;
END;
DROP i;
RUN;
options missing='H';
PROC PRINT DATA=H_TEMP_RECORD2;
RUN;
options missing='.';
If you are going to use the list of variables _numeric_ then all the numeric variables will be in the list. If you specify a number in the array definition, such as {13} and that doesn't match the number of _numeric_ variables that will throw an error. The {*} says use the number of variables in the list to set the array size. And possibly list the variables. If you have any DATE, time or datetime values they are very likely to get set to missing when using _numeric_ list in this fashion.
Your attempt to check the value was outside the "do i=" loop. So no value was available for the array to use in that assignment (i missing) and invalid as an array index.
"missing" in a data step is a function to test whether a value is missing.
I think you were attempting to set the option missing to display 'H' which I have shown above.
Another approach would be to assign a special missing:
DATA H_TEMP_RECORD2;
SET H_TEMP_RECORD;
ARRAY VARS {*} _NUMERIC_;
DO i=1 to dim(vars);
IF VARS(i)>40 THEN VARS(i)=.H;
END;
DROP i;
RUN;
SAS has 27 "special missing" values .A through .Z and ._ that you can use to differentiate different types of "missingness". They will appear in printed output a A through Z or just _ without the dot.