06-24-2016 12:52 PM
Here is the code that I am using.
ods graphics on;
options ls=80 ps=50 nodate pageno=1;
Infile '/home/tmaciver7840/my_content/hbat tabs.txt' DLM = '09'X TRUNCOVER;
Input ID X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11 X12 X13 X14 X15 X16 X17 X18 X19
X20 X21 X22 X23;
The output data just shows the columns and there is nothing in the results. I don't see the actual data (screenshots attached). Where am I going wrong here? Thanks
07-01-2016 07:13 PM
If you don't specify a library then the default would be to assign the data to the WORK library. The Work library contents are deleted when you close the session. So if you want the data available without re-reading the file then it is best to create a permanent library
You have errors but you do not show the part of the log that would show the actual text of the errors. The bit displayed in the first PNG is typical when you specify a delimiter or other options in the INFILE incorrectly. Note that the second block of data starting with 71 (which indicates the position in the data line) has X18.104.22.168.1 etc. and then just continues to 141 (and I'm guessing there are further lines),
First that indicates that SAS attempted to read the values of X1 X2 etc for the numeric variables X1. You likely wanted to have the option FirstObs=2 on the INFILE statement to skip what is likely a header row in the input file.
There may also be an issue with the end of line character of the dataset being other than the program expects (or completely missing). You may need to use the TERMSTR= option on the Infile statement, Possibly TERMSTR=CR if the file originated on a Mac. If the original file was PC then TERMSTR=CRLF may be needed, TERMSTR=LF for Unix.
07-01-2016 08:19 PM - edited 07-01-2016 08:39 PM
I always wonder why people post photographs of their log? Isn't it easier to copy and paste the TEXT from the log rather than taking a picture of it and trying to figure out how to get this web site to accept the picture?
Anyway the first picture shows your error.
First you are trying the read the header row as data and second SAS is not seeing the end of line. You aslo probably want to add the DSD option to make sure it handles missing values properly.
infile '/home/tmaciver7840/my_content/hbat tabs.txt' DSD DLM = '09'X TRUNCOVER FIRSTOBS=2 TERMSTR=CR ;