The size of y will depend on the length of the character variables in the data set. A variable with length=256 takes twice as much RAM as one that has length=128.
Look at the MEMSIZE option (second link) to allocate more memory. Since you are computing a maximum, you can also break the data into chunks, as shown in the third link. To build on Ian's program:
proc iml;
use one nObs N;
chunkSize = N/ 10;
max = .;
do data;
read next (chunkSize) var _CHAR_ into y[colname=cNames];
c = length(y);
if max=. then max = c[<>, ];
else max = (max // c[<>, ])[<>, ];
end;
close one;
k = t( cnames// char(max) );
print k;
... View more