Oh I'm sorry. I tried removing lines of code to find the error. This is the error I got in the first place: 1
65
66 /* begin SAS/IML solution */
67 proc iml;
NOTE: IML Ready
68 use class;
69 read all var {OrderID} into C;
69 ! /* =OrderID */
70 read all var {ChannelShort} into x;
70 ! /* =ChannelShort? */
71 read all var {position};
72 close;
NOTE: Closing WORK.CLASS
73
74 /* unique-loc technique:
75 http://blogs.sas.com/content/iml/2011/11/01/the-unique-loc-trick-a-real-treat.html */
76 s = j(ncol(u), 1+max(position), blankstr(32));
NOTE: Module BLANKSTR loaded from the storage SASHELP.IMLMLIB.
ERROR: (execution) Invalid operand to operation.
operation : J at line 76 column 6
operands : _TEM1001, _TEM1003, _TEM1004
_TEM1001 1 row 1 col (numeric)
0
_TEM1003 1 row 1 col (numeric)
767
_TEM1004 1 row 1 col (character, size 32)
statement : START at offset 1 column 1
77 do i = 1 to ncol(u);
78 idx = loc(C=u[i]);
79 s[i, 1] = u[i];
80 s[i, 2:ncol(idx)+1] = rowvec(x[idx]);
81 end;
82
83
84 print s;
ERROR: Matrix s has not been set to a value.
statement : PRINT at line 84 column 1
85
86 %put &sysvlong;
9.04.01M3P062415
87
88
89 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
101
... View more