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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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
  • 608 views
  • 0 likes
  • 2 in conversation