1. A non-transitory computer readable recording medium having stored therein an encoding program that causes a computer to execute a process comprising: extracting a registered word from a plurality of first words registered in a dynamic dictionary when encoding a target file with a static dictionary and the dynamic dictionary, the registered word being included in an external dictionary and registered in the dynamic dictionary, the external dictionary associating respective word in a specific word group and respective code in a code group, the plurality of first words in the dynamic dictionary being not registered in the static dictionary; and associating a corresponding code and a dynamic code of the registered word in the dynamic dictionary, the corresponding code being associated with the registered word in the external dictionary, the dynamic code being associated with the registered word in the dynamic dictionary.