data _null_;
set ave.emp;
NEWSAL=sal;
put ' ';
put 'CURRENT SALARY FOR ' dept=10 ' IS ' sal;
newsal=newsal+newsal*.10;
put 'CURRENT SALARY FOR ' dept=20 ' IS ' sal;
newsal=newsal+newsal*.20;
put 'CURRENT SALARY FOR ' dept=30 ' IS ' sal;
newsal=newsal+newsal*.30;
do lily = 1 to 3;
put ' AND HIS EXPECTED SALARY FOR THE ' lily ' YEAR IS ' newsal;
end;
run;
For Task 2 is this correct?
did you post data for testing and debugging?
Did you test your code yourself?
I and others would test for you if you included data.
Tip #2:
You will need to learn how to determine which data is for department 10, which is for department 20, etc. That depends on what exactly is in your data, so we can only guess until we see some data.
OK, so you have DEPTNO that tells you what the department number is. Do you know how to use it in an IF THEN statement to process only the department 10 observations?
I do know how to use if then statements however I need to create the datavset using only do loop or iterative do statement
OK, then set up within the DATA step a statement that will process only department 10 observations, another that processes only department 20 observations, and a third that processes only department 30 observations. Test your DATA step and see if the log contains any errors or notes about anything going wrong.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.