Without knowing how &NUMATT is being created (%LET or CALL SYMPUT) or what the whole rest of the program is doing, it looks like &NUMATT is going to supply a value for the LENGTH and the other statements. For example, if &NUMATT is 4, then the compiler would receive this "resolved" code:
LENGTH scorepattern $10 attpattern $4;
scorepattern = CAT(OF item scoreatt1-scoreatt4);
attpattern = CAT(OF scoreatt1-scoreatt4);
and if the macro variable &NUMATT had been assigned a value of 6, then this would be the "resolved" code that was sent to the compiler:
LENGTH scorepattern $10 attpattern $6;
scorepattern = CAT(OF item scoreatt1-scoreatt6);
attpattern = CAT(OF scoreatt1-scoreatt6);
You are dealing with the WORK.KERNEL data -- how does it get created?? If you do a PROC CONTENTS on WORK.KERNEL, how do the SCOREATT1-SCOREATTn variables get created??? How many numbered variables are there? Can the number of "SCOREATT" variables change and if so, based on what condition??
> cat() function is identical with ' || ' ,except that
> length of concatenated result is 200, and ' || ' has
> not this limit.
In a DATA step, if the CAT function returns a value to a variable that has not previously been assigned a length, then that variable is given a length of 200 bytes. If the concatenation operator (||) returns a value to a variable that has not previously been assigned a length, then that variable is given a length that is the sum of the lengths of the values which are being concatenated.