write output into workfile using edit mask

Hi,

I am trying to write some data into a workfile where I want a particular field in a specific format(like XXXX-XXXXX-XXXX-XXXX)

But when I am trying to write into a workfile it is not working and giving me an error. But this works when I try to print it on the normal Natural screen.

Appreciate if you could suggest the code or any other way to acheive it.
You can also mail me your replies directly to me on my email address that is ssamantasinghar@gmail.com

Please let me know if you need more information about the same.

Thank you!!!
Smruti Kanta

From the Documentation:

"Fields written with a WRITE WORK FILE statement are represented in the external file according to their internal definition. No editing is performed on the field values.

For fields of format A and B, the number of bytes in the external file is the same as the internal length definition as defined in the Natural program. "

The compiler error refers to an illegal subscript; which is what Natural thinks the EM clause is.

The rather simple fix is to perform a MOVE EDITED of your “source field” into another field, and write that to the work file.

steve

http://tech.forums.softwareag.com/viewtopic.php?t=7056

Thank you very much

I will try to run my adhoc report code by using move edited and will let you know if I come across anything unusual

As always thanks again for your valuable updates!!!