In which dynasty did the word society first appear in China ancient books?

Appeared in the Tang Dynasty.

After consulting, the word "society" was first mentioned in "Old Tang Shuxuan Comprehensive Merchants", and "Old Tang Shuxuan Comprehensive Merchants" was a work of the Tang Dynasty.

Dynasty, a China word, refers to the whole ruling period handed down from generation to generation by the emperor who established the title of the country.