I'm trying to create a csv by using fmt to create a string for each row. I want to create a date field in a certain format. If I leave the code in there to do this, my output file seems is double spaced (each row on every other line). But if I take that code out, the output appears correctly. What am I doing wrong?
<SQL ROW "select field1,field2,field3 from mytable where field1=$qryval">
<sandr " " " " $field3>
<sandr " " " " $ret>
<sandr "|" "" $ret>
<$newfield3=$ret>
<!-- if i remove this if statement, output file is correct -->
<if $field1 ne 'NULL'>
<strfmt "%m/%d/%y" $field1>
<$newfield1=$ret>
</if>
<fmt "%s|%s|%s\n" $field1 $field2 $field3>
</sql>
<SQL ROW "select field1,field2,field3 from mytable where field1=$qryval">
<sandr " " " " $field3>
<sandr " " " " $ret>
<sandr "|" "" $ret>
<$newfield3=$ret>
<!-- if i remove this if statement, output file is correct -->
<if $field1 ne 'NULL'>
<strfmt "%m/%d/%y" $field1>
<$newfield1=$ret>
</if>
<fmt "%s|%s|%s\n" $field1 $field2 $field3>
</sql>