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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 610 views
  • 2 likes
  • 3 in conversation