05-20-2014 11:50 AM
I have a output file (.txt) that I would like to read in to SAS. The delimiter used in the file is blank. I want to read every row (where some variables start from the very first column while the others have trailing blanks in front of them). Is there a way that I can read every thing (all the variables including the ones after the trailing blanks) into SAS as one variable? I tried using semi colon with keyword, using @ to change the point, and some other ways and none of them worked. The output is attached. I would like to read in the row stating the warning message after the line "THE MODEL ESTIMATION TERMINATED NORMALLY".
Any help is appreciated.
05-20-2014 12:05 PM
I think you will have to provide the forum with at least a small subset of the data you are trying to read, as well as what you expect from that data as a result.
05-20-2014 12:48 PM
I think you meant Leading blanks.
And do you want all of the data in a single variable containing the whole row of data? Something like
Var = ' 123 12341234123412341234 09808 adrasf'
Then a data step does that easily enough
infile "your file name" LRECL=32000; /* or length of longest line*/
input var $varying32000. ; /* again length of longest line*/
05-20-2014 02:32 PM
sorry. My mistake. I did mean leading blanks. I tried the code and it works after I added the length of the variable after $varying informat. Thanks a lot!