Hi Statalist,

I am working with a four-digit integer variable, ISCO08_1. I would like to simply drop the last three digits, and create a one-digit integer variable "ISCO". So far I have tried versions of egen with the cut function, but am generating nothing but missing values. My data and code are below. I am grateful for your advice.

* Example generated by -dataex-. To install: ssc install dataex
clear
input int ISCO08_1
3343
3115
3343
3132
5141
5322
3251
2341
7511
5230
4222
7127
2636
9321
9111
9622
9214
7223
3343
1211
3411
5311
4221
3434
9111
5411
2341
5153
5153
7411
3343
5153
5230
2636
9411
9111
4321
3251
8171
5222
2423
2529
8152
5322
9411
3132
3132
2641
5230
5222
4222
2221
3512
2212
2353
1112
5141
9412
2163
2412
2142
7543
5322
8183
5131
7126
5169
2611
1311
9214
2212
5312
2263
2164
2514
3322
3339
3313
1211
9412
7322
7422
3221
3313
5169
3221
3115
1330
2641
2636
2221
8183
4321
2221
9214
2341
9112
2622
2330
7212
end
label values ISCO08_1 ISCO08_1
[/CODE]

Code:
egen ISCO = cut(ISCO08_1), at(1)
(1842103 missing values generated)

. 
end of do-file

. codebook ISCO

----------------------------------------------------------------------------------------------------
ISCO                                                                                     (unlabeled)
----------------------------------------------------------------------------------------------------

                  type:  numeric (float)

                 range:  [.,.]                        units:  .
         unique values:  0                        missing .:  1,842,103/1,842,103

            tabulation:  Freq.  Value
                     1,842,103  .