Ran into a peculiar problem while writing to a file using File Layouts today. Fields that had a space in the database was being converted to null while writing to the file. Did all the obvious checks like ensuring the Trim Spaces and Strip White Spaces properties of the FileLayout were unchecked.
Then ran into the File Class property - UseSpaceForNull. This property was introduced in Peopletools 8.48 and does the neat job of ensuring that spaces are printed in the output file instead of nulls when attempting to print fields that indeed had a space in database. It is a read-write property and has to be used immediately after instantiating the file layout as shown below:
<* Example starts
If &FILE1.IsOpen Then
If &FILE1.SetFileLayout(FileLayout.FL_NAME) Then
/* has to be used immediately after instantiating the file layout */
&FILE1.UseSpaceForNull = True;
<* Example ends