Hi, I am new to SAS, so please bear with me, and I am mostly using it for data manipulation. The problem I am trying to solve is updating a variable in a dataset based upon value from another dataset. My datastructure is below: Dataset1 - Agent_Shift Variables: Report_Date, Employee_ID, Shift_Code, Avail_Category, Start_moment (timestamp), End_Moment (timestamp) This data set has the timespans for an agent's Shift, Overtime, and Makeup time. Below, for example Agent1234 is scheduled to work from 01MAR2015:07:00:00 to 01MAR2015:16:30:00 is the schedule span / shift and the same employee has Overtime from 16:30 to 18:00. Agent_Shift dataset: This dataset would update the Avail_category of Agent_Schedule_Details below Report_Date Agent_ID Shift_Code Start_Moment End_Moment Avail_Category 1-Mar-15 1234 SHIFT 01MAR2015:07:00:00.000000 01MAR2015:16:30:00.000000 Schedule Span 1-Mar-15 1234 OVPH 01MAR2015:16:30:00.000000 01MAR2015:18:00:00.000000 Gross OT Dataset2 - Agent_Schedule_Details Variables: Report_Date, Employee_ID, Shift_Code, Avail_Category (currently blank), Start_moment (timestamp), End_Moment (timestamp) This dataset contains the transactional timestamps of an agents workday. For example agent 1234 was scheduled for production work at 5 different times throughout the day (PRD), had 2 breaks at specific time stamps as well as a lunch. Agent_Schedule_Details dataset (Avail_Category will need to be updated from Avail Category of Agent_Shift) Report_Date Agent_ID Shift_Code Start_Moment End_Moment Avail_Category 1-Mar-15 1234 CKEY 01MAR2015:07:00:00.000000 01MAR2015:07:08:00.000000 Should be Schedule Span 1-Mar-15 1234 PRD 01MAR2015:07:08:00.000000 01MAR2015:10:30:00.000000 Should be Schedule Span 1-Mar-15 1234 BRK1 01MAR2015:10:30:00.000000 01MAR2015:10:45:00.000000 Should be Schedule Span 1-Mar-15 1234 PRD 01MAR2015:10:45:00.000000 01MAR2015:14:00:00.000000 Should be Schedule Span 1-Mar-15 1234 LUNCH 01MAR2015:14:00:00.000000 01MAR2015:14:30:00.000000 Should be Schedule Span 1-Mar-15 1234 PRD 01MAR2015:14:30:00.000000 01MAR2015:15:37:00.000000 Should be Schedule Span 1-Mar-15 1234 BRKL 01MAR2015:15:37:00.000000 01MAR2015:15:52:00.000000 Should be Schedule Span 1-Mar-15 1234 PRD 01MAR2015:15:52:00.000000 01MAR2015:16:30:00.000000 Should be Schedule Span 1-Mar-15 1234 BRKO 01MAR2015:16:45:00.000000 01MAR2015:17:00:00.000000 Should be Gross OT 1-Mar-15 1234 PRD 01MAR2015:17:00:00.000000 01MAR2015:18:00:00.000000 Should be Gross OT The issue I am having is how do I update the Avail category based on the Avail_Category and timestamp of the Agent_Shift dataset? I know there should be logic to see if the start and stop timestamps of each observation within Agent_Schedule_Details falls with the time stamp of the observations for the Agents_Shift. I am just struggling with how to do this update.
... View more