I'm trying to insert a number 100.00 S9(13)V9(2) comp-3n in a txt file.
COMP-3 (packed-decimal) is not
valid in a "text file".
You can create a text file or you can create a file with packed-decimal data, but they will not be the same file.
If you explain the requirement, we can probably offer suggestions on how to proceed.