


NOTE: 2 records were read from the infile TEST.Īs you can see in this example, run on Windows, each line ends with CR and LF characters (0D and 0A in hex codes). To test a larger file you might want to skip the beginning so as not to flood the log with information you don't need. For a small sample file just dump the whole file.

To check how the file really ends read the file using a SAS data step and dump the text using $HEX format to see exactly what is there at the end. If you are using a text editor then they will generally show an extra line so that you have some place to type new text you want to add at the end. It sounds like whatever tool you are using to look at the file is showing an extra line. We cannot test with the code you posted since we do not have either the input data or the definition of the macros you are calling.īut I suspect that the file is fine and there is some type of misunderstanding about how text files are constructed. I had tried using the RECFM = n option inthe last DATA _null_ step but no success. SET &INFILE._TLR /this is my input dataset containig a single line trailer data*/ %let _PREX12_FILE = &_ddpath.&_dd_sdir./&FILENAME.txt this is my path to unix server where file will be createdįILE "&_PREX12_FILE." NEW TERMSTR=LF recfm=n With the current code I am able to achieve LF as the record terminator, but this adds a extra blank line at end of file(which is not required). Requirement is LF(line feed) as record terminator. I have been trying to create a txt file with a format such as 1st row as header, from 2nd row i have datalines and last row as a trailer record.
