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;
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.