BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
JQian
Fluorite | Level 6

Hi,

Does anyone know how to import PRN type files (table) into SAS? Not sure if this type of file can be imported in SAS, if anyone has ideas, that would be great. Thanks for helping.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

The last time I worked with files that had a PRN extension they were Lotus 1-2-3 "print" files. Which were text intended to print in such a way that when you printed them to paper and matched the records then the lines would extend across multiple sheets.

These were fixed column with the column widths set by the spreadsheet software. If that is what you have, then you can write a SAS data step to read them. But it is not trivial because if a record exceeds the width of a piece of paper, typically about 80 columns, then you have to write code so that line 1 can be matched with the rest of that line.

 

If by PRN the file is a specific printer text markup, that's much more problematic.

 

If by Import you mean Proc Import, maybe. Really depends on the text file.

 

I strongly suggest copying the entire text of one of these files opened with a plain text editor such as Notepad, copy the text and open a text box on the forum using the </> icon above the message window and pasting the text so we can see the file.

View solution in original post

2 REPLIES 2
Reeza
Super User
PRN is often just text, is yours text or from a different application that may be proprietary?
ballardw
Super User

The last time I worked with files that had a PRN extension they were Lotus 1-2-3 "print" files. Which were text intended to print in such a way that when you printed them to paper and matched the records then the lines would extend across multiple sheets.

These were fixed column with the column widths set by the spreadsheet software. If that is what you have, then you can write a SAS data step to read them. But it is not trivial because if a record exceeds the width of a piece of paper, typically about 80 columns, then you have to write code so that line 1 can be matched with the rest of that line.

 

If by PRN the file is a specific printer text markup, that's much more problematic.

 

If by Import you mean Proc Import, maybe. Really depends on the text file.

 

I strongly suggest copying the entire text of one of these files opened with a plain text editor such as Notepad, copy the text and open a text box on the forum using the </> icon above the message window and pasting the text so we can see the file.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 2 replies
  • 1049 views
  • 2 likes
  • 3 in conversation