Thanks for the help. Will update if i get my codes working. 🙂
@Anmolkhandelwal wrote:
I have tried this approach. Tried writing the last line in a different data _null_ with recfm = n and no "0a" as terminator with my put statements, this does remove the extra line that was created earlier but the terminator for this trailer comes to be blank. i am trying to get the terminator as LF for last line without generating a blank line after that.
SAS will normally write a space after a VARIABLE when writing using list mode. It does not do that after fixed text in the PUT statement, like in my example.
To avoid this use formatted mode instead. You can use the $VARYING with character variables.
Say you have a character variable named MYVAR that is defined with a length of 200. So instead of using:
put myvar;
You would use:
len=lengthn(myvar);
put myvar $varying200. len;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.