/* --------------------------------------------------------------------------- $Revision: 1.1.2.7 $ $Date: 2015/10/20 07:00:23 $ NAME: cxt_src_file_reader.sas DESCRIPTION: SAS VERSION: 9.4 INPUT: OUTPUT: CALLS: CALLED BY (optional): PRECONDITIONS (optional): POSTCONDITIONS (optional): HISTORY: userid yyyymmdd defectid desc sinshd 20120711 sinmhg 20151005 S1207231 Added Informats for mandatory character columns ------------------------------------------------------------------------------ Copyright (c) 2005-2015, SAS Institute Inc., Cary, NC, USA, All Rights Reserved ------------------------------------------------------------------------------ */ %macro cxt_src_file_reader (file_var=,src_file=)/*/STORE*/; %if &src_file = ATTRIBUTION %then %do; length attribution_seq_no 8 attribution_start_csa $ 32 attribution_ts 8 campaign $ 260 campaign_tracking_code $ 65 creative $ 260 placement $ 390 referrer $ 1332 referrer_domain $ 215 referrer_query $ 1332 response_tracking_cd $ 14 searchengine $ 130 searchengine_domain $ 215 searchengine_term $ 1332 session_number $ 29 subject_id_1 $ 32 subject_id_2 $ 32 subject_id_3 $ 32 subject_id_4 $ 32 subject_id_5 $ 32 type $ 65; infile &file_var dlm = '01'x dsd; input attribution_seq_no attribution_start_csa $ attribution_ts campaign $ campaign_tracking_code $ creative $ placement $ referrer $ referrer_domain $ referrer_query $ response_tracking_cd $ searchengine $ searchengine_domain $ searchengine_term $ session_number $ subject_id_1 $ subject_id_2 $ subject_id_3 $ subject_id_4 $ subject_id_5 $ type $ ; format attribution_ts attribution_seq_no 32.; informat campaign $char260. type $char65.; %end; %else %if &src_file = BASKET %then %do; length attribution_start_csa $ 32 cart_currency $ 4 csa_NUMBER $ 29 order_id $ 42 record_ts 8 record_type $ 15 session_NUMBER $ 29 total_cart_value $ 20 view_sequence_no 8 billing_city $ 390 shipping_city $ 390 shipping_country $ 85 billing_country $ 85 billing_postcode $ 10 shipping_postcode $ 10 billing_region $ 256 shipping_region $ 256 cart_id $ 42 delivery_type $ 42 payment_type $ 42 shipping_cost $ 20 tax $ 20; infile &file_var dlm = '01'x dsd; input attribution_start_csa $ cart_currency $ csa_NUMBER $ order_id $ record_ts record_type $ session_NUMBER $ total_cart_value $ view_sequence_no billing_city $ shipping_city $ shipping_country $ billing_country $ billing_postcode $ shipping_postcode $ billing_region $ shipping_region $ cart_id $ delivery_type $ payment_type $ shipping_cost $ tax $ ; format record_ts view_sequence_no 32.; informat record_type $char15.; %end; %else %if &src_file = BASKET_ACTION %then %do; length action $ 20 action_timestamp 8 attribution_start_csa $ 32 csa_NUMBER $ 29 product_id $ 130 product_name $ 130 product_group $ 130 product_quantity 8 product_sku $ 100 product_unit_price $ 20 session_NUMBER $ 29 view_sequence_no 8 cart_id $ 42 product_currency $ 6 total_cart_value $ 20 total_cart_items 8; infile &file_var dlm = '01'x dsd; input action $ action_timestamp attribution_start_csa $ csa_NUMBER $ product_id $ product_name $ product_group $ product_quantity product_sku $ product_unit_price $ session_NUMBER $ view_sequence_no cart_id $ product_currency $ total_cart_value $ total_cart_items; format total_cart_items action_timestamp view_sequence_no 32.; informat action $char20.; %end; %else %if &src_file = BASKET_ITEM %then %do; length attribution_start_csa $ 32 csa_number $ 29 product_currency $ 6 product_id $ 130 product_name $ 130 product_group $ 130 product_quantity 8 product_sku $ 100 product_unit_price $ 20 record_type $ 15 session_number $ 29 view_sequence_no 8 availability_msg $ 650 shipping_msg $ 650 saving_msg $ 650; infile &file_var dlm = '01'x dsd; input attribution_start_csa $ csa_number $ product_currency $ product_id $ product_name $ product_group $ product_quantity product_sku $ product_unit_price $ record_type $ session_number $ view_sequence_no availability_msg $ shipping_msg $ saving_msg $; format view_sequence_no product_quantity 32.; informat record_type $char15.; %end; %else %if &src_file = DOCUMENTS %then %do; length alt_text $ 1332 attribution_start_csa $ 32 clicked_timestamp 8 csa_number $ 29 object_id $ 1332 object_link $ 2265 object_name $ 1332 session_number $ 29 view_sequence_no 8 object_selector_path $ 1332; infile &file_var dlm = '01'x dsd; input alt_text $ attribution_start_csa $ clicked_timestamp csa_number $ object_id $ object_link $ object_name $ session_number $ view_sequence_no object_selector_path $ ; format clicked_timestamp view_sequence_no 32.; informat object_link $char2265.; %end; %else %if &src_file = CUSTOM_ATTRIBUTE %then %do; length att_dttm 8 attribution_start_csa $ 32 csa_number $ 29 custom_att_name $ 32 custom_att_value $ 650 session_number $ 29 view_sequence_no 8; infile &file_var dlm = '01'x dsd; input att_dttm attribution_start_csa $ csa_number $ custom_att_name $ custom_att_value $ session_number $ view_sequence_no ; format att_dttm view_sequence_no 32.; informat custom_att_name $char32. custom_att_value $char650.; %end; %else %if &src_file = FORM_PATH %then %do; length attempt_index 8 attribution_start_csa $ 32 change_index 8 csa_number $ 29 event_ts 8 field_name $ 325 field_id $ 325 following_csa_no $ 32 form_name $ 65 session_number $ 29 status $ 42 value $ 2600 view_sequence_no 8 was_submit 8 ; infile &file_var dlm = '01'x dsd; input attempt_index attribution_start_csa $ change_index csa_number $ event_ts field_name $ field_id $ following_csa_no $ form_name $ session_number $ status $ value $ view_sequence_no was_submit ; format attempt_index change_index event_ts view_sequence_no was_submit 32.; informat field_name $char325. field_id $char325. form_name $char65. status $char42. value $char2600.; %end; %else %if &src_file = GOAL %then %do; length attribution_start_csa $ 32 csa_number $ 29 goal_name $ 260 goal_timestamp 8 revenue $ 20 session_number $ 29 view_sequence_no 8 goal_group_name $ 130; infile &file_var dlm = '01'x dsd; input attribution_start_csa $ csa_number $ goal_name $ goal_timestamp revenue $ session_number $ view_sequence_no goal_group_name $ ; format goal_timestamp view_sequence_no 32.; informat goal_name $char260.; %end; %else %if &src_file = INTERNAL_SEARCH %then %do; length attribution_start_csa $ 32 results_displayed 8 results_displayed_flg 8 session_number $ 29 int_srch_name $ 65 phrase $ 2600 search_timestamp 8 srch_field_name $ 325 srch_field_id $ 325 srch_page_csa_number $ 29 srch_page_view_seq_no 8; infile &file_var dlm = '01'x dsd; input attribution_start_csa $ results_displayed results_displayed_flg session_number $ int_srch_name $ phrase $ search_timestamp srch_field_name $ srch_field_id $ srch_page_csa_number $ srch_page_view_seq_no ; format results_displayed results_displayed_flg search_timestamp srch_page_view_seq_no 32.; informat int_srch_name $char65. phrase $char2600. srch_field_name $char325. srch_field_id $char325.; %end; %else %if &src_file = MEDIA %then %do; length attribution_start_csa $ 32 csa_number $ 29 media $ 260 media_player $ 30 media_player_version $ 20 media_url $ 2024 play_start_ts 8 session_number $ 29 video_len 8 view_sequence_no 8; infile &file_var dlm = '01'x dsd; input attribution_start_csa $ csa_number $ media $ media_player $ media_player_version $ media_url $ play_start_ts session_number $ video_len view_sequence_no ; format play_start_ts video_len view_sequence_no 32.; informat media $char260. media_url $char2024.; %end; %else %if &src_file = MEDIA_HR %then %do; length csa_number $ 29 exit_playhead_time 8 max_playhead_time 8 view_sequence_no 8 viewing_time 8 media_time 8 play_end_ts 8 interaction_count 8 media $ 200 media_url $ 2024 playhead_start_time 8 playhead_stop_time 8; infile &file_var dlm = '01'x dsd; input csa_number $ exit_playhead_time max_playhead_time view_sequence_no viewing_time media_time play_end_ts interaction_count media $ media_url $ playhead_start_time playhead_stop_time ; format exit_playhead_time max_playhead_time view_sequence_no viewing_time media_time play_end_ts interaction_count playhead_start_time playhead_stop_time 32.; informat media $char200. media_url $char2024.; %end; %else %if &src_file = NEW_SESSIONS %then %do; length browser_type $ 52 browser_version $ 16 city_name $ 390 client_start_ts 8 cookies_enabled 8 country_code $ 2 country_name $ 85 device $ 85 device_type $ 52 flash_version $ 16 ip_address $ 64 java_enabled 8 java_version $ 12 language $ 12 latitude $ 13 longitude $ 13 organisation $ 256 platform $ 78 previous_session_number $ 29 region_code $ 2 region_name $ 256 screen_color_depth 8 screen_res_height 8 screen_res_width 8 server_start_ts 8 session_number $ 29 UID $ 32 user_agent $ 1024 profile1 $ 52 profile2 $ 52 profile3 $ 52 profile4 $ 52 profile5 $ 52 returning_visitor_flg 8 session_timeout $ 20 metro_code 8 postal_code $ 10 ; infile &file_var dlm = '01'x dsd; input browser_type $ browser_version $ city_name $ client_start_ts cookies_enabled country_code $ country_name $ device $ device_type $ flash_version $ ip_address $ java_enabled java_version $ language $ latitude $ longitude $ organisation $ platform $ previous_session_number $ region_code $ region_name $ screen_color_depth screen_res_height screen_res_width server_start_ts session_number $ uid $ user_agent $ profile1 $ profile2 $ profile3 $ profile4 $ profile5 $ returning_visitor_flg session_timeout $ metro_code postal_code $ ; format client_start_ts cookies_enabled java_enabled screen_color_depth screen_res_height screen_res_width server_start_ts returning_visitor_flg metro_code 32.; informat browser_type $char52. browser_version $char16. ip_address $char64. UID $char32.; %end; %else %if &src_file = PAGE_ERRORS %then %do; length attribution_start_csa $ 32 csa_number $ 29 error_desc $ 260 session_number $ 29 view_sequence_no 8 error_attribute_a $ 20 error_attribute_b $ 20 error_timestamp 8; infile &file_var dlm = '01'x dsd; input attribution_start_csa $ csa_number $ error_desc $ session_number $ view_sequence_no error_attribute_a $ error_attribute_b $ error_timestamp ; format view_sequence_no error_timestamp 32.; informat error_desc $char260.; %end; %else %if &src_file = PRODUCT %then %do; length attribution_start_csa $ 32 csa_number $ 29 product_id $ 130 product_name $ 130 product_group $ 130 product_unit_price $ 20 product_sku $ 100 session_number $ 29 view_sequence_no 8 view_timestamp 8 availability_msg $ 650 product_currency $ 6 saving_msg $ 650 shipping_msg $ 650; infile &file_var dlm = '01'x dsd; input attribution_start_csa $ csa_number $ product_id $ product_name $ product_group $ product_unit_price $ product_sku $ session_number $ view_sequence_no view_timestamp availability_msg $ product_currency $ saving_msg $ shipping_msg $ ; format view_sequence_no view_timestamp 32.; %end; %else %if &src_file = PROMOTION %then %do; length attribution_start_csa $ 32 campaign_tracking_code $ 65 creative $ 260 csa_number $ 29 displayed_timestamp 8 placement $ 260 promotion $ 260 response_tracking_cd $ 14 session_number $ 29 subject_id_1 $ 32 subject_id_2 $ 32 subject_id_3 $ 32 subject_id_4 $ 32 subject_id_5 $ 32 treatment_tracking_cd $ 32 type $ 65 used_timestamp 8 record_type $ 10 derived_display_flg 8 promotion_no 8 view_sequence_no 8; infile &file_var dlm = '01'x dsd; input attribution_start_csa $ campaign_tracking_code $ creative $ csa_number $ displayed_timestamp placement $ promotion $ response_tracking_cd $ session_number $ subject_id_1 $ subject_id_2 $ subject_id_3 $ subject_id_4 $ subject_id_5 $ treatment_tracking_cd $ type $ used_timestamp record_type $ derived_display_flg promotion_no view_sequence_no; format displayed_timestamp used_timestamp derived_display_flg promotion_no view_sequence_no 32.; informat promotion $char260. type $char65. record_type $char10.; %end; %else %if &src_file = SESSIONS %then %do; length active_session_duration_ms 8 network_data_volume 8 network_duration 8 server_last_activity_ts 8 session_duration_ms 8 session_number $ 29 user_data_volume 8 user_duration 8 last_user_id $ 128 session_timeout $ 20; infile &file_var dlm = '01'x dsd; input active_session_duration_ms network_data_volume network_duration server_last_activity_ts session_duration_ms session_number $ user_data_volume user_duration last_user_id $ session_timeout $ ; format active_session_duration_ms network_data_volume network_duration server_last_activity_ts session_duration_ms user_data_volume user_duration 32.; %end; %else %if &src_file = TRANSACTION_STEP %then %do; length attrib1_name $ 130 attrib2_name $ 130 attribution_start_csa $ 32 csa_number $ 29 following_csa_no $ 32 is_completionpoint 8 session_number $ 29 step_attempt_index 8 step_name $ 130 step_path_index 8 step_timestamp 8 trns_instance_no 8 trns_name $ 130 view_sequence_no 8 error_desc $ 1300 error_ts 8; infile &file_var dlm = '01'x dsd; input attrib1_name $ attrib2_name $ attribution_start_csa $ csa_number $ following_csa_no $ is_completionpoint session_number $ step_attempt_index step_name $ step_path_index step_timestamp trns_instance_no trns_name $ view_sequence_no error_desc $ error_ts ; format is_completionpoint step_attempt_index step_path_index step_timestamp trns_instance_no view_sequence_no error_ts 32.; informat following_csa_no $char32. step_name $char130. trns_name $char130.; %end; %else %if &src_file = VIEWS %then %do; length alias0 $ 1332 alias1 $ 650 alias2 $ 650 alias3 $ 650 alias4 $ 650 alias5 $ 650 alias6 $ 650 alias7 $ 650 alias8 $ 650 alias9 $ 650 alias10 $ 650 alias11 $ 650 alias12 $ 650 alias13 $ 650 alias14 $ 650 attribution_start_csa $ 32 browser_size_height 8 browser_size_width 8 content_size 8 csa_number $ 29 images_complete_time 8 load_time 8 load_timestamp 8 login $ 52 page_id $ 650 page_title $ 1332 session_number $ 29 url_domain $ 215 view_sequence_no 8 server_start_ts 8; infile &file_var dlm = '01'x dsd; input alias0 $ alias1 $ alias2 $ alias3 $ alias4 $ alias5 $ alias6 $ alias7 $ alias8 $ alias9 $ alias10 $ alias11 $ alias12 $ alias13 $ alias14 $ attribution_start_csa $ browser_size_height browser_size_width content_size csa_number $ images_complete_time load_time load_timestamp login $ page_id $ page_title $ session_number $ url_domain $ view_sequence_no server_start_ts; format browser_size_height browser_size_width content_size images_complete_time load_time load_timestamp view_sequence_no server_start_ts 32.; informat alias0 $char1332.; %end; %else %if &src_file = VIEWS_HR %then %do; length csa_number $ 29 is_dead_end 8 page_active_time 8 page_view_time 8 view_sequence_no 8 session_number $ 29; infile &file_var dlm = '01'x dsd; input csa_number $ is_dead_end page_active_time page_view_time view_sequence_no session_number $ ; format is_dead_end page_active_time page_view_time view_sequence_no 32.; %end; %else %if &src_file = ERROR %then %do; length event_no 8 load_no 8 error_dttm 8 ace_rest_api_job_id $ 100 error_source_cd $ 10 location_txt $ 60 error_type_txt $ 128 error_txt $ 4000; infile &file_var dlm = '01'x dsd; input event_no load_no error_dttm ace_rest_api_job_id $ error_source_cd $ location_txt $ error_type_txt $ error_txt $; format event_no load_no error_dttm 32.; %end; %mend;