Hi Tom, I was able to use the By variables as explained above. Which helps to simplify the program, removing the merge as well and this in turn improved memory usage. Thanks a lot for the help. data pt_all_planteam_temp ; set NDIAOUT.plan_mgmt_staffname_nodup_hist; by ParentPartyID g_snapshot_start_date g_snapshot_end_date ; length All_Planners $255; retain All_Planners; if first.g_snapshot_end_date then All_Planners=cat(trim(Plan_mgmt_team_member)," (",trim(Participant_Management_Role_Desc),")") ; else All_Planners=catx("; ",trim(All_Planners),cat(trim(Plan_mgmt_team_member)," (",trim(Participant_Management_Role_Desc),")")) ; if last.g_snapshot_end_date; keep ParentPartyID g_snapshot_start_date g_snapshot_end_date All_Planners; run;
... View more