I'm trying to run the following bitpack decoder. A macro is called:
%macro decoderloop_v1(var);
*call missing(decod);*this here causes intantiation or decod as scalar not array;
array mask[9] _temporary_ (1 2 4 8 16 8160 1040384 66060288 4227858432);
array start_bit_pos[9] _temporary_ (0:5 13 20 26);
array decod[9];
call pokelong(repeat(put(0,rb8.),8),addrlong(decod[1]),72);
*initialize values of decod to all 0, replaces bad call missing and array defaults which do not reinitialize upon data step iteration;
do _n_=1 to 9;*no macro loop, loop in data step instead of generating repeated code;
decod[_n_]=brshift(band(mask[_n_],&var),start_bit_pos[_n_]);
end;
%mend decoderloop_v1;
The above macro is called from the following:
DATA WORK.QUERY_FOR_GETS_DW_EOA_FAULTS;
%decoderloop_v1(SUBID_IN_HEX);
SET WORK.QUERY_FOR_GETS_DW_EOA_FAULTS;
SUBID_IN_HEX = SUBID ;
FORMAT SUBID_IN_HEX $hex.;
array SUBID_Decoded{9} decod;
RUN;
I get the following error:
229 array SUBID_Decoded{9} decod;
ERROR: Too few variables defined for the dimension(s) specified for the array SUBID_Decoded.
Please help me debug the code. Thanks.