1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK; 68 69 DATA _NULL_; 70 C_MTH = STRIP(INTNX('MONTH',TODAY(),-1)); /*REPORTING MONTH IS AUGUST2023 OR ANY MONTH PREVIOUS TO THE CURRENT MONTH*/ 71 CALL SYMPUT (CATS('RMTH'),CATT(STRIP(PUT(INTNX('MONTH',C_MTH,0),MONNAME3.)))); /*ONLY MONTH NAME FOR REPORTING PURPOSES*/ 72 CALL SYMPUT (CATS('REP_MTH'),CATT(LOWCASE(PUT(INTNX('MONTH',C_MTH,0),MONYY7.))) );/*ONLY MONTH & YEAR FORMAT REPORTING 72 ! PURPOSES*/ 73 CALL SYMPUT 73 ! (CATS('ACT_MTH'),CATT(LOWCASE(STRIP(PUT(INTNX('MONTH',C_MTH,0),MONNAME3.))),STRIP(PUT(INTNX('YEAR',C_MTH,0),YEAR2.)))) ; 73 ! /*ONLY MONTH & YEAR FORMAT REPORTING PURPOSES*/ 74 CALL SYMPUT (CATS('PERIOD'),PUT(INTNX('MONTH',TODAY(),-1),YYMMDDN6.));/*DATE FORMAT FOR EXTRACTION*/ 75 CALL SYMPUT (('RUN_DAYS'),PUT(DAY(INTNX('MONTH',C_MTH,0,'E')),Z2.)); /*NUMBER OF DAYS OF THE MONTH*/ 76 RUN; NOTE: Numeric values have been converted to character values at the places given by: (Line):(Column). 70:15 NOTE: Character values have been converted to numeric values at the places given by: (Line):(Column). 71:56 72:61 73:67 73:112 75:49 NOTE: DATA statement used (Total process time): real time 0.00 seconds user cpu time 0.01 seconds system cpu time 0.00 seconds memory 897.81k OS Memory 20640.00k Timestamp 09/15/2023 02:29:16 AM Step Count 482 Switch Count 0 Page Faults 0 Page Reclaims 104 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 77 %PUT "RMTH &RMTH."; "RMTH Aug" 78 %PUT "REP_MTH &REP_MTH."; "REP_MTH aug2023" 79 %PUT "ACT_MTH &ACT_MTH."; "ACT_MTH aug23" 80 %PUT "PERIOD &PERIOD."; "PERIOD 230801" 81 %PUT "RUN_DAYS &RUN_DAYS."; "RUN_DAYS 31" 82 83 84 %MACRO DATA_PULL(); 85 %DO i = 0 %TO 2; *%EVAL(&RUN_DAYS. -1); 86 %LET MTH&i. = %SYSFUNC(PUTN(&i.,Z2.)); 87 DATA _NULL_; 88 C_MTH = STRIP(INTNX('MONTH',TODAY(),-1)); 89 CALL SYMPUT (CATS("TDY&i."),STRIP(PUT(INTNX('DAY',(INTNX('MONTH',C_MTH,0)),&i.),YYMMDDN8.))); 90 CALL SYMPUT (CATS("PTDY&i."),STRIP(PUT(INTNX('DAY',(INTNX('MONTH',C_MTH,0)),%EVAL(&i.+1)),YYMMDDN8.))); 91 RUN; 92 93 %PUT "DAYS&i. = &&TDY&i."; 94 %PUT "PTDAYS&i. = &&PTDY&i."; 95 96 /*WE ARE EXTRACTING DATA FROM TERADATA SALES TABLE. UISNG BETWEEN START DATE AND END DATE FOR A PERIOD OF EXTRACTION.*/ 97 98 DATA ST&i.; 99 STDTE = "&&TDY&i."; 100 ENDDTE = "&&PTDY&i."; 101 RUN; 102 103 104 %END; 105 106 %MEND; 107 %DATA_PULL(); NOTE: Numeric values have been converted to character values at the places given by: (Line):(Column). 107:29 NOTE: Character values have been converted to numeric values at the places given by: (Line):(Column). 107:123 107:219 NOTE: DATA statement used (Total process time): real time 0.00 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds memory 542.34k OS Memory 20896.00k Timestamp 09/15/2023 02:29:16 AM Step Count 483 Switch Count 0 Page Faults 0 Page Reclaims 47 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 "DAYS0 = 20230801" "PTDAYS0 = 20230802" NOTE: The data set WORK.ST0 has 1 observations and 2 variables. NOTE: DATA statement used (Total process time): real time 0.00 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds memory 661.78k OS Memory 21156.00k Timestamp 09/15/2023 02:29:16 AM Step Count 484 Switch Count 2 Page Faults 0 Page Reclaims 100 Page Swaps 0 Voluntary Context Switches 10 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 264 NOTE: Numeric values have been converted to character values at the places given by: (Line):(Column). 107:29 NOTE: Character values have been converted to numeric values at the places given by: (Line):(Column). 107:123 107:219 NOTE: DATA statement used (Total process time): real time 0.00 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds memory 542.34k OS Memory 20896.00k Timestamp 09/15/2023 02:29:16 AM Step Count 485 Switch Count 0 Page Faults 0 Page Reclaims 30 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 "DAYS1 = 20230802" "PTDAYS1 = 20230803" NOTE: The data set WORK.ST1 has 1 observations and 2 variables. NOTE: DATA statement used (Total process time): real time 0.00 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds memory 661.78k OS Memory 21156.00k Timestamp 09/15/2023 02:29:16 AM Step Count 486 Switch Count 2 Page Faults 0 Page Reclaims 93 Page Swaps 0 Voluntary Context Switches 12 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 264 NOTE: Numeric values have been converted to character values at the places given by: (Line):(Column). 107:29 NOTE: Character values have been converted to numeric values at the places given by: (Line):(Column). 107:123 107:219 NOTE: DATA statement used (Total process time): real time 0.00 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds memory 654.46k OS Memory 20896.00k Timestamp 09/15/2023 02:29:16 AM Step Count 487 Switch Count 0 Page Faults 0 Page Reclaims 27 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 "DAYS2 = 20230803" "PTDAYS2 = 20230804" NOTE: The data set WORK.ST2 has 1 observations and 2 variables. NOTE: DATA statement used (Total process time): real time 0.00 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds memory 661.78k OS Memory 21156.00k Timestamp 09/15/2023 02:29:16 AM Step Count 488 Switch Count 2 Page Faults 0 Page Reclaims 93 Page Swaps 0 Voluntary Context Switches 12 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 264 108 109 110 111 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK; 121