Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
data work.totalsales; set work.monthlysales(keep = year product sales); retain monthsales {12}; array monthsales {12}; do i = 1 to 12; monthsales{i} = sales; end; count + 1; monthsales{count} = sales; run;
我提交这些代码。但它似乎有语法问题。但是哪里?
语法问题是retain语句中的数组样式名称。
retain
count由于未初始化,可能出现运行时错误。如果“monthlysales”中有超过 12 条记录,您将在第 13 条记录上收到“array out of bounds”错误。
count