Hi

I am working with the following data:

Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input str9 id int date_actual float month_actual long bizdate
"000361AH8" 18981 623   0
"000361AH8" 18983 623   2
"000361AH8" 18984 623   3
"000361AH8" 18988 623   4
"000361AH8" 18989 623   5
"000361AH8" 18995 624   8
"000361AH8" 18996 624   9
"000361AH8" 18997 624  10
"000361AH8" 18998 624  11
"000361AH8" 19002 624  13
"000361AH8" 19003 624  14
"000361AH8" 19016 624  22
"000361AH8" 19017 624  23
"000361AH8" 19019 624  25
"000361AH8" 19025 625  29
"000361AH8" 19036 625  36
"000361AH8" 19037 625  37
"000361AH8" 19038 625  38
"000361AH8" 19039 625  39
"000361AH8" 19040 625  40
"000361AH8" 19045 625  42
"000361AH8" 19046 625  43
"000361AH8" 19050 625  45
"000361AH8" 19051 625  46
"000361AH8" 19054 626  49
"000361AH8" 19060 626  53
"000361AH8" 19071 626  60
"000361AH8" 19073 626  62
"000361AH8" 19074 626  63
"000361AH8" 19075 626  64
"000361AH8" 19080 626  67
"000361AH8" 19085 627  70
"000361AH8" 19087 627  72
"000361AH8" 19088 627  73
"000361AH8" 19092 627  74
"000361AH8" 19093 627  75
"000361AH8" 19096 627  78
"000361AH8" 19100 627  80
"000361AH8" 19102 627  82
"000361AH8" 19103 627  83
"000361AH8" 19106 627  84
"000361AH8" 19107 627  85
"000361AH8" 19108 627  86
"000361AH8" 19109 627  87
"000361AH8" 19110 627  88
"000361AH8" 19115 628  91
"000361AH8" 19117 628  93
"000361AH8" 19120 628  94
"000361AH8" 19121 628  95
"000361AH8" 19122 628  96
"000361AH8" 19123 628  97
"000361AH8" 19128 628 100
"000361AH8" 19130 628 102
"000361AH8" 19135 628 105
"000361AH8" 19136 628 106
"000361AH8" 19137 628 107
"000361AH8" 19142 628 109
"000361AH8" 19145 629 112
"000361AH8" 19149 629 114
"000361AK1" 19074 626  63
"000361AK1" 19075 626  64
"000361AK1" 19078 626  65
"000361AK1" 19080 626  67
"000361AK1" 19085 627  70
"000361AK1" 19096 627  78
"000361AK1" 19100 627  80
"000361AK1" 19108 627  86
"000361AK1" 19117 628  93
"000361AK1" 19128 628 100
"000361AK1" 19134 628 104
"000361AK1" 19135 628 105
"000361AK1" 19138 628 108
"000361AK1" 19151 629 116
"000361AM7" 19080 626  67
"000361AM7" 19086 627  71
"000361AM7" 19115 628  91
"000361AM7" 19136 628 106
"000361AM7" 19137 628 107
"000361AM7" 19138 628 108
"000361AM7" 19148 629 113
"000361AP0" 19005 624  16
"00037BAA0" 19116 628  92
"00037BAA0" 19117 628  93
"00037BAA0" 19120 628  94
"00037BAA0" 19121 628  95
"00037BAA0" 19122 628  96
"00037BAA0" 19123 628  97
"00037BAA0" 19124 628  98
"00037BAA0" 19127 628  99
"00037BAA0" 19128 628 100
"00037BAA0" 19129 628 101
"00037BAA0" 19130 628 102
"00037BAA0" 19131 628 103
"00037BAA0" 19135 628 105
"00037BAA0" 19136 628 106
"00037BAA0" 19137 628 107
"00037BAA0" 19138 628 108
"00037BAA0" 19142 628 109
"00037BAA0" 19143 628 110
"00037BAA0" 19144 628 111
end
format %td date_actual
format %tm month_actual
format %tbsp500abc bizdate
where the date_actual and month_actual is the date and month as reported. I create a business date (bizdate) from the date_actual. I actually want to check if the date within the month (for some id) falls in the last 5 business days of the month and if the date within the month falls in the first 5 business days of the month. This information will be used further, so if I could create an indicator variable etc. it would be great. Currently the business dates start from the start of the actual dates. Thank You in advance for help.

Regards