Hi folks, I supose this is a very simple question, but I haven't found an answer.
I'm using the PUT statement to write into a file a collection of numbers. The problem is that I need them to be a character but when using the PUT UNFORMATTED it writes it as number instead. There is an example of code and the result.
OUTPUT TO VALUE(cFilePath) APPEND.
PUT UNFORMATTED cId.
If I print the value of cId it's '0123', but the value written in the file is '123'.
Any idea about how to use PUT to write it correctly?
Thanks in advance.
Remove the "UNFORMATTED " option.
Remove the "UNFORMATTED " option.
So is cId a INT or CHAR? You should really include its DEF VAR and also how you populate the data.
Or if you can't for other reasons remove the UNFORMATTED option, could you convert them to string before or in the put statement with the formatting wanted. I.E. PUT UNFORMAT string(cid,"9999").
Thanks for the answers. It was really helpful!
|
||||
Brian Maher
|
||||
Principal Engineer, Technical Support
|
||||
Progress
|
||||
14 Oak Park | Bedford, MA 01730 | USA
|
||||
|
||||
|
Is there an echo in here? ;-) [tag:GreatMindsThinkALike] #ButFoolsNeverDiffer