Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input str10 VDS_ID str5 SUR_MON_YR str42 PROG_NAME long AMT_BEN str10 WHO_BEN str1 WHO_SPENT
"IAP10A0008" "06/11" "Public dist. system(rice,wheat, etc.)     "  170 "          " "B"
"IAP10A0008" "06/11" "Mid day meal                              "   90 "14,205    " "B"
"IAP10A0008" "05/11" "Public dist. system(rice,wheat, etc.)     "  170 "          " "B"
"IAP10A0008" "04/11" "Public dist. system(rice,wheat, etc.)     "  170 "4,12      " "B"
"IAP10A0008" "04/11" "Mid day meal                              "  100 "14,205    " "B"
"IAP10A0008" "03/11" "Public dist. system(rice,wheat, etc.)     "  170 "4         " "B"
"IAP10A0008" "03/11" "Mid day meal                              "  150 "14,205    " "B"
"IAP10A0008" "02/11" "Public dist. system(rice,wheat, etc.)     "  170 "4         " "B"
"IAP10A0008" "02/11" "Mid day meal                              "  160 "14,205    " "B"
"IAP10A0008" "01/11" "Public dist. system(rice,wheat, etc.)     "  175 "4         " "B"
"IAP10A0008" "01/11" "Mid day meal                              "  140 "14,205    " "B"
"IAP10A0008" "12/10" "Public dist. system(rice,wheat, etc.)     "  175 "4         " "B"
"IAP10A0008" "12/10" "Mid day meal                              "  170 "14,205    " "B"
"IAP10A0008" "11/10" "Public dist. system(rice,wheat, etc.)     "  175 "4         " "B"
"IAP10A0008" "11/10" "Mid day meal                              "  160 "14,205    " "B"
"IAP10A0008" "10/10" "Public dist. system(rice,wheat, etc.)     "  185 "4         " "B"
"IAP10A0008" "10/10" "Mid day meal                              "  120 "14,205    " "B"
"IAP10A0008" "09/10" "Public dist. system(rice,wheat, etc.)     "  175 "4         " "B"
"IAP10A0008" "09/10" "Mid day meal                              "  140 "14,205    " "B"
"IAP10A0008" "08/10" "Public dist. system(rice,wheat, etc.)     "  170 "4,12      " "B"
"IAP10A0008" "08/10" "Mid day meal                              "  150 "14,205    " "B"
"IAP10A0008" "07/10" "Public dist. system(rice,wheat, etc.)     "  170 "4         " "B"
"IAP10A0008" "07/10" "Mid day meal                              "  140 "14,205    " "B"
"IAP10A0009" "06/11" "Public dist. system(rice,wheat, etc.)     "  320 "2         " "F"
"IAP10A0009" "06/11" "Pensions (old age, widow, etc.            "  200 "2         " "F"
"IAP10A0009" "05/11" "Public dist. system(rice,wheat, etc.)     "  320 "2         " "F"
"IAP10A0009" "05/11" "Pensions (old age, widow, etc.            "  200 "2         " "F"
"IAP10A0009" "04/11" "Public dist. system(rice,wheat, etc.)     "  320 "2         " "F"
"IAP10A0009" "04/11" "Pensions (old age, widow, etc.            "  200 "2         " "F"
"IAP10A0009" "03/11" "Public dist. system(rice,wheat, etc.)     "  320 "2         " "F"
"IAP10A0009" "03/11" "Pensions (old age, widow, etc.            "  200 "2         " "F"
"IAP10A0009" "02/11" "Public dist. system(rice,wheat, etc.)     "  320 "2         " "F"
"IAP10A0009" "02/11" "Pensions (old age, widow, etc.            "  200 "2         " "F"
"IAP10A0009" "01/11" "Public dist. system(rice,wheat, etc.)     "  320 "2         " "F"
"IAP10A0009" "01/11" "Pensions (old age, widow, etc.            "  200 "2         " "F"
"IAP10A0009" "12/10" "Public dist. system(rice,wheat, etc.)     "  320 "2         " "F"
"IAP10A0009" "12/10" "Pensions (old age, widow, etc.            "  200 "2         " "F"
"IAP10A0009" "11/10" "Public dist. system(rice,wheat, etc.)     "  310 "2         " "F"
"IAP10A0009" "11/10" "Pensions (old age, widow, etc.            "  200 "2         " "F"
"IAP10A0009" "10/10" "Public dist. system(rice,wheat, etc.)     "  325 "2         " "F"
"IAP10A0009" "10/10" "Pensions (old age, widow, etc.            "  200 "2         " "F"
"IAP10A0009" "09/10" "Public dist. system(rice,wheat, etc.)     "  320 "2         " "F"
"IAP10A0009" "09/10" "Pensions (old age, widow, etc.            "  200 "2         " "F"
"IAP10A0009" "08/10" "Public dist. system(rice,wheat, etc.)     "  320 "2         " "F"
"IAP10A0009" "08/10" "Pensions (old age, widow, etc.            "  200 "2         " "F"
"IAP10A0009" "07/10" "Public dist. system(rice,wheat, etc.)     "  320 "2         " "B"
"IAP10A0009" "07/10" "Pensions (old age, widow, etc.            "  200 "2         " "B"
"IAP10A0010" "06/11" "Public dist. system(rice,wheat, etc.)     "  120 "          " "B"
"IAP10A0010" "06/11" "Pensions (old age, widow, etc.            "  200 "3         " "B"
"IAP10A0010" "05/11" "Public dist. system(rice,wheat, etc.)     "  120 "          " "B"
"IAP10A0010" "05/11" "Pensions (old age, widow, etc.            "  200 "3         " "B"
"IAP10A0010" "04/11" "Public dist. system(rice,wheat, etc.)     "  120 "3,4       " "B"
"IAP10A0010" "03/11" "Public dist. system(rice,wheat, etc.)     "  120 "3         " "B"
"IAP10A0010" "02/11" "Public dist. system(rice,wheat, etc.)     "  120 "3         " "B"
"IAP10A0010" "01/11" "Public dist. system(rice,wheat, etc.)     "  110 "3,4       " "B"
"IAP10A0010" "12/10" "Public dist. system(rice,wheat, etc.)     "  110 "3         " "B"
"IAP10A0010" "11/10" "Public dist. system(rice,wheat, etc.)     "  110 "3,4       " "B"
"IAP10A0010" "10/10" "Public dist. system(rice,wheat, etc.)     "  115 "3         " "B"
"IAP10A0010" "09/10" "Public dist. system(rice,wheat, etc.)     "  104 "3         " "B"
"IAP10A0010" "09/10" "Crop insurance, drought or flood relief   " 1800 "3         " "B"
"IAP10A0010" "08/10" "Public dist. system(rice,wheat, etc.)     "  104 "3,4       " "B"
"IAP10A0010" "07/10" "Public dist. system(rice,wheat, etc.)     "  104 "3         " "B"
"IAP10A0030" "06/11" "Public dist. system(rice,wheat, etc.)     "  120 "          " "B"
"IAP10A0030" "05/11" "Public dist. system(rice,wheat, etc.)     "  120 "          " "B"
"IAP10A0030" "04/11" "Public dist. system(rice,wheat, etc.)     "  120 "1,2       " "B"
"IAP10A0030" "03/11" "Public dist. system(rice,wheat, etc.)     "  120 "1         " "B"
"IAP10A0030" "02/11" "Public dist. system(rice,wheat, etc.)     "  110 "1         " "B"
"IAP10A0030" "01/11" "Public dist. system(rice,wheat, etc.)     "  110 "1,2       " "B"
"IAP10A0030" "12/10" "Public dist. system(rice,wheat, etc.)     "  110 "1         " "B"
"IAP10A0030" "11/10" "Public dist. system(rice,wheat, etc.)     "  105 "1,2       " "B"
"IAP10A0030" "10/10" "Public dist. system(rice,wheat, etc.)     "  110 "1         " "B"
"IAP10A0030" "09/10" "Public dist. system(rice,wheat, etc.)     "  100 "1         " "B"
"IAP10A0030" "08/10" "Public dist. system(rice,wheat, etc.)     "  100 "1,2       " "B"
"IAP10A0030" "07/10" "Public dist. system(rice,wheat, etc.)     "  104 "1         " "B"
"IAP10A0034" "06/11" "Public dist. system(rice,wheat, etc.)     "  320 "          " "B"
"IAP10A0034" "06/11" "Mid day meal                              "   30 "13        " "F"
"IAP10A0034" "06/11" "Others (ABAYAHASTHAM)                     "  500 "2         " "B"
"IAP10A0034" "05/11" "Public dist. system(rice,wheat, etc.)     "  320 "          " "B"
"IAP10A0034" "05/11" "Others (ABAYAHASTAM)                      "  500 "2         " "B"
"IAP10A0034" "04/11" "Public dist. system(rice,wheat, etc.)     "  320 "3         " "B"
"IAP10A0034" "04/11" "Mid day meal                              "   50 "13        " "F"
"IAP10A0034" "04/11" "Others (ABAYAHASHAM)                      "  500 "2         " "B"
"IAP10A0034" "03/11" "Public dist. system(rice,wheat, etc.)     "  320 "3         " "B"
"IAP10A0034" "03/11" "Mid day meal                              "   80 "13        " "F"
"IAP10A0034" "03/11" "Others (ABAYAHASHAM)                      "  500 "2         " "B"
"IAP10A0034" "02/11" "Public dist. system(rice,wheat, etc.)     "  320 "3         " "B"
"IAP10A0034" "02/11" "Mid day meal                              "   85 "13        " "F"
"IAP10A0034" "02/11" "Others (ABAYAHASHAM PENTION)              "  500 "2         " "B"
"IAP10A0034" "01/11" "Public dist. system(rice,wheat, etc.)     "  340 "3         " "B"
"IAP10A0034" "01/11" "Mid day meal                              "   70 "13        " "F"
"IAP10A0034" "01/11" "Others-ABAYAHASTHAM                       "  500 "2         " "B"
"IAP10A0034" "12/10" "Public dist. system(rice,wheat, etc.)     "  320 "3         " "B"
"IAP10A0034" "12/10" "Mid day meal                              "   95 "13        " "F"
"IAP10A0034" "12/10" "Others (ABAYAHASHAM PENSION)              "  500 "2         " "B"
"IAP10A0034" "11/10" "Public dist. system(rice,wheat, etc.)     "  320 "3         " "B"
"IAP10A0034" "11/10" "Mid day meal                              "   90 "13        " "F"
"IAP10A0034" "11/10" "ABAYAHASHAM PENSION                       "  500 "2         " "B"
"IAP10A0034" "10/10" "Public dist. system(rice,wheat, etc.)     "  335 "3         " "B"
"IAP10A0034" "10/10" "Mid day meal                              "   60 "13        " "F"
"IAP10A0034" "10/10" "Others (ABAYAHASTHAM PENSION)             "  500 "2         " "B"
end
i want to arrange this data set in such a way that observations in variable PROG_NAME can be separated in categories given below.


SUR_MON_YR HH_ID Public dist. system(rice,wheat, etc.) MID_DAY_MEAL EDUCATION_RELATED_SUBSIDIES PENSION HEALTH_PROG ELECTRICITY&POWER OTHERS
.....
SO lets observation in PROG_NAME having words like book, school, hostel, fees, school dress should come under EDUCATION_RELATED_SUBSIDIES.
and observation having terms like electricity, power, should come under ELECTRICITY&POWER column.
and terms like ABAYAHASHAM, PENSION, Pensions should come under PENSION COLUMN
so please help me to write a code which can categorize observations on the basis of some keywords in variable.