School variable versus occupation

In the U.S. Census data from 1860 to 1900, why do we see differences between the variable labeled ‘school’ and the category ‘at school’ within the occupation variable? Are they based on different coding schemes or respondent answers?

Using the Census enumeration form instructions, I checked 1860 and 1880, in both those years enumerators collected information both on schooling (“Attended school within the census year”) and on occupation (“Profession, occupation, or trade of each person, male or female”). The 1850-1900 Census samples use the same coding scheme for OCC which includes code 304 (Student). Since respondents were able to respond both to school attendance and occupation, it is reasonable to expect that some respondents were working AND attending school, which explains why there is not a complete match between occupation as student and school attendance. Additionally. when I cross-tabulate OCC and SCHOOL in 1880, I see that the vast majority of those who attended school (SCHOOL==2) had an occupation as student or are missing for OCC. The other major occupation codes for respondents who reported they were in school were “agricultural laborers,” “at home” or “other non-occupational response” which all seem like reasonable occupations for those attending school in these years.