In SQR, How do we write varying length strings repeatedly into a file without introducing a newline
On writing a text file using SQR, the carriage return and the line feed at the end of the file writes up automatically.
In this case, we need to generate a file that is compatible with other system such as DOS. In order for us to do this, one option is to use “fixed_nolf” in the sqr open statement. This specifies that all records contained within the file are the same length with no line terminator/line feed.
!open $outputfile as 12 for-writing record=200:vary
open $outputfile as 12 for-writing record=200:fixed_nolf
============================================================================
let $cr = chr(13)
WRITE 12 from 'P' $sep $EMPLID $sep $NAME $sep $ACAD_ORG $sep $A_PROG_TYPE $sep