- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
if I need sas to read in txt file with header and trailer, how to do it?
I saw some program it has the followings:
%LET HEADER_IND=N;
%LET TRAILER_IND=N;
do in my case I will put 'Y' instead?
what else do I need?
does it assume one line for header and one line for trailer?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Please provide a sample with header, some data and trailer rows. Use the "bracket icon" to share this text or alternatively attach it as a text file.
Then based on the sample text you share explain/show the desired result (like: is the header the column names that you want to use as variable names or something else).
"bracket icon"
We need to understand if header and footer are just always the first and last line in your text file, or if there could be multiple lines of header and footer and you have some sort of a line type indicator in column one, or ... Sharing representative sample data will answer all these questions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
That would be better if you post this TEXT file and the OUTPUT you would like to see.
Anyway, here is an example:
data have;
infile "c:\temp\outfile.txt" length=len truncover;
input have $varying800. len;
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
It all depends on how these macro variables are used later in the code. Read the documentation of the program.