BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
robertrao
Quartz | Level 8

Hi Team,

This example is from page 5 of the paper below.

http://www.sys-seminar.com/EE/Files/Arrays_Made_Easy(1).pdf

CAN ANYONE FROM THE TEAM EXPLAIN TO ME THE TECHNIQUE HOW SAS IS ABLE TO SPECIFICALLY CONSIDER 4th POSITION IN THE ARRAY(0.20 value) WHEN IT SEES A month_ delinquent equal to 4

WITHOUT ARRAY PROCESSING

if month_delinquent eq 1 then balance = balance + (balance * 0.05);
else if month_delinquent eq 2 then balance = balance + (balance * 0.08);
else if month_delinquent eq 3 then balance = balance + (balance * 0.12);
else if month_delinquent eq 4 then balance = balance + (balance * 0.20);
else if month_delinquent eq 5 then balance = balance + (balance * 0.27);
else if month_delinquent eq 6 then balance = balance + (balance * 0.35);

WITH ARRAY PROCESSING

array rate {6} _temporary_ (0.05 0.08 0.12 0.20 0.27 0.35);
if month_delinquent ge 1 and month_delinquent le 6 then
balance = balance + (balance * rate{month_delinquent});

1 ACCEPTED SOLUTION

Accepted Solutions
data_null__
Jade | Level 19

rate{month_delinquent}

Array elements are referenced through their index.  The VALUE of month_delinquent provides the index in this example.  Just as if you had written rate{4}

View solution in original post

2 REPLIES 2
data_null__
Jade | Level 19

rate{month_delinquent}

Array elements are referenced through their index.  The VALUE of month_delinquent provides the index in this example.  Just as if you had written rate{4}

robertrao
Quartz | Level 8

Thanks so much _null_. I get it now..

Regards

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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