BookmarkSubscribeRSS Feed
Hart
Calcite | Level 5
so i had little proc tabulate exp & cant figure out how to make mine work.


data national;

array num [3] n_total n_reas n_noreas;
array pct [3] noreas_pct reas_pct in_pct;

retain n_total n_reas reas_pct n_noreas noreas_pct in_pct;
set national;
by offtype2;

if first.offtype2 then
do i = 1 to 3;
num = .; pct = .;
end;

if _type_ in ('00', '10') then n_total=n;
else if _type_ in ('01', '11') then
do;
num[hasreas]=n;

if _type_ = '01' then num[hasreas]=pctn_00; /* TOTAL ROW */
else pct[hasreas]=pctn_10; /* ANY OTHER ROW */
end;

if last.offtype2 then output;

run;


i keep getting the out of range array error message..
1 REPLY 1
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
You will want to add some PUTLOG _ALL_; SAS statements in your DATA step, to debug what's happening along the way - that should help reveal the problem situation and cause. Also, otherwise having posted the SAS log information which would provide SAS variable values at the time of the error would go along with helping others debug your program.

Scott Barry
SBBWorks, Inc.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 766 views
  • 0 likes
  • 2 in conversation