Question: Not understanding why the code is resulting in a error. Please help with explanation. 72 73 LIBNAME ORION X:/2021 Module 1-7; NOTE: Libref ORION was
Not understanding why the code is resulting in a error. Please help with explanation. 

72 73 LIBNAME ORION "X:/2021 Module 1-7"; NOTE: Libref ORION was successfully assigned as follows: Engine: V9 Physical Name: X:\2021 Module 1-7 74 75 PROC SQL; 76 SELECT EMPLOYEE_ID 77 FROM ORION. EMPLOYEE_PAYROLL 78 WHERE MONTH(EMPLOYEE_HIRE_DATE)=MONTH(SYSDATE) 79 AND (SYSDATE - Employee_Hire_Date) / 30*12 >= 1; ERROR: Function MONTH requires a numeric expression as argument 1. ERROR: Expression using equals (=) has components that are of different data types. ERROR: The following columns were not found in the contributing tables: SYSDATE. NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements. 80 81 Level 2 2. Using a Noncorrelated Subquery Each month a memo is that lists the employees who have employment anniversaries for that month is posted. Create the report for the current month and list Employee_ID and the first and last names for all employees hired during the current month of any year. You can find Employee_Name in the orion.employee_addresses table and Employee_Hire_Date in the orion.employee_payroll table. Both tables contain the column Employee_ID Order the report by an employee's last name. a. Create a query that returns a list of employee IDs for employees with a current anniversary. The query should do the following: Display Employee_ID numbers. Use the orion.employee_payroll table. Return only employees whose hire date (Employee_Hire_Date) is in the current month. Add a title to the report as shown. Partial PROC SQL Output (Generated when current month = February) Employee IDs for Current Month Anniversaries Employee_ID 120107 120116 120136 120162 120164 72 73 LIBNAME ORION "X:/2021 Module 1-7"; NOTE: Libref ORION was successfully assigned as follows: Engine: V9 Physical Name: X:\2021 Module 1-7 74 75 PROC SQL; 76 SELECT EMPLOYEE_ID 77 FROM ORION. EMPLOYEE_PAYROLL 78 WHERE MONTH(EMPLOYEE_HIRE_DATE)=MONTH(SYSDATE) 79 AND (SYSDATE - Employee_Hire_Date) / 30*12 >= 1; ERROR: Function MONTH requires a numeric expression as argument 1. ERROR: Expression using equals (=) has components that are of different data types. ERROR: The following columns were not found in the contributing tables: SYSDATE. NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements. 80 81 Level 2 2. Using a Noncorrelated Subquery Each month a memo is that lists the employees who have employment anniversaries for that month is posted. Create the report for the current month and list Employee_ID and the first and last names for all employees hired during the current month of any year. You can find Employee_Name in the orion.employee_addresses table and Employee_Hire_Date in the orion.employee_payroll table. Both tables contain the column Employee_ID Order the report by an employee's last name. a. Create a query that returns a list of employee IDs for employees with a current anniversary. The query should do the following: Display Employee_ID numbers. Use the orion.employee_payroll table. Return only employees whose hire date (Employee_Hire_Date) is in the current month. Add a title to the report as shown. Partial PROC SQL Output (Generated when current month = February) Employee IDs for Current Month Anniversaries Employee_ID 120107 120116 120136 120162 120164
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
