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.
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.
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 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.