BookmarkSubscribeRSS Feed
RameshReddy
Calcite | Level 5

Hi,

I am generating .prn fromat form sas using this code

DATA NULL;

  FILE "path /sample.prn"

SET  datasetname;

put  JOB_CODE $2.  YEAR_MONTH $6. '  ' BRANCH_CODE $7. ITEM_CODE 3. NO_OF_ACCOUNT_OTHERS zeros.    ;

RUN;

These are diffent formats applied

while opening .prn in word pad i am able to get result

but when iam opening it in notepad i am unable to get result in each line

as second line of result is comming in first line of .txt

kindly look into issue and help

1 REPLY 1
Tom
Super User Tom
Super User

I usually see that behavior when opening text files generated on Unix.  Unix uses just a LineFeed ('0A'x) as the end of line indicator, while DOS (Windows) uses a CarriageReturn ('0D'x) and LineFeed at the end of each line.  WordPad is smart enough to intrepret the lines that end only in a LF but Notepad is not.

You can force SAS to write the CR into the end of the lines by adding the TERMSTR=CRLF option to your FILE statement.

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

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!

Register now

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

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
  • 1 reply
  • 2974 views
  • 0 likes
  • 2 in conversation