BookmarkSubscribeRSS Feed
Karan_Dumbre
Calcite | Level 5

Write a SAS program to create a forecasting application to compute number of employees in each of the department of Orion Star after 10 years. 

Below is the dataset

4 REPLIES 4
Karan_Dumbre
Calcite | Level 5

i was trying to put a loop for increment but each of the observation have different increment numbers so how should proceed

RW9
Diamond | Level 26 RW9
Diamond | Level 26

As @PeterClemmensen has said, what have you tried?  Post test data in the form of a datastep in the post using a code window - its the {i}.  Post what the output should look like.  Supply any code you have tried, or logic you may want included.

Karan_Dumbre
Calcite | Level 5
data g1;
set "/folders/myshortcuts/myfolder/Imarticus/prg2/growth.sas7bdat";
year = 0;
do while (year < = 10);
if _N_ = 1 then
Total_employees + (total_employees * 0.25);
else if _N_ = 2 then
Total_employees + (total_employees * 0.3);
else if _N_ = 3 then
Total_employees + (total_employees * 0.1);
else if _N_ = 4 then
Total_employees + (total_employees * 0.2);
else if _N_ = 5 then
Total_employees + (total_employees * 0.3);
else if _N_ = 6 then
Total_employees + (total_employees * 0.1);
end;
run;

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 4 replies
  • 797 views
  • 0 likes
  • 3 in conversation