Hello, I am new to SAS and have a problem using the SAS/IML. When I use the following code, it shows the following error. The code is from a textbook I use to create a word matrix, but I get an error message and blank matrix. Can anybody give me some suggestions for this problem? Thank you. libname d'/folders/myfolders/song';
options ps=500 ls=132;
data worddata;
infile '/folders/myfolders/song/70songs.txt' delimiter='';
input word: $20. @@;
LW=length(word);
check=substr(word,LW,1);
data voclist;
infile "/folders/myfolders/song/voclist.txt";
input voc $;
proc iml; reset fw=5;
workspace=30000;
use worddata;
read all var {word} into w;
read all var {check} into c;
use voclist;
read all var _char_ into v;
w=concat(w,c);
d=j(nrow(v),nrow(v),0);
LW=length(w);
tagi=0;tagj=0;
check=substr(w,LW,1);
do i=1 to nrow(v);
vis=v(|i,1|);
do j=1 to nrow(v);
vjs=v(|j,1|);
L1=length(vis);
LJ=length(vjs);
k=1; ti=0; tj=0;
jf=j(nrow(w),1,0);
loop: do position = k to (nrow(w)-1) until (check(|position,1|)="#");
wsi=substr(w(|position,1|),1,LI);
wsj=substr(w(|position,1|),1,LJ);
if v(|i,l|)=wsi then do;
tagi=tagi+1; ti=ti+1; end;
if v(|j,1|)=wsj then do;
tagj=tagj+1; tj=tj+1; end;
end;
jf[position,1]=min(ti,tj);
k=position+1; ti=0; tj=0;
if position<nrow(w) then goto loop;
s=sum(jf);
d[i,j]=d(|i,j|)+s;
end;
end;
print d;
create d.network from d;
append from d;
quit; Error message: ERROR: (execution) Matrix has not been set to a value Log: ... 126 end; ERROR: (execution) Matrix has not been set to a value. operation : SUBSTR at line 110 column 11 operands : _TEM1001, *LIT1022, LI _TEM1001 1 row 1 col (character, size 40) 가는 � *LIT1022 1 row 1 col (numeric) 1 LI 0 row 0 col (type ?, size 0) statement : ASSIGN at line 110 column 1 127 128 print d; 129 130 create d.network from d; 131 append from d; 132 quit;
... View more