BookmarkSubscribeRSS Feed
Anmolkhandelwal
Obsidian | Level 7

Thanks for the help. Will update if i get my codes working. 🙂

Tom
Super User Tom
Super User

@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;
Satish_Parida
Lapis Lazuli | Level 10
Could you check if you have a Line Feed, carriage return or New Line character in FILLER/TRANS_AMT or any other variable. They can cause to create a new line.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 17 replies
  • 5297 views
  • 0 likes
  • 5 in conversation