Start addressing problems starting at the top of a program.
The first problem I see is a bunch of invalid data messages. Those occur when you try to read incompatible data from the instructions you have provided on the INPUT statement and Informats. Such as trying to read "abc" as a numeric value or reading a date that looks like 01JAN2020 with a YYMMDD informat that expects values like 20200101.
So since your data step
69 Data CrossOver;
70 infile "/home/u44908311/food_crossover_project/FoodCrossOverExample.sas";
71 input Subject Gender $ BMI Age Sequence $ Period Treatment $ Baseline After Difference;
72 run;
it looks like you are trying to read a PROGRAM file, not data.
Lets examine the first "invalid data message" and describe how to read and interpret what it shows.
Please see in the first few lines where it has one of the Variable names from the INPUT statement and some details. First indicator is that there are different LINES mentioned. Those are lines in the source file.
So Subject was read from the first line starting at column 1 through 4 and was invalid. Your Input statement indicates subject should contain a numeric value so something not valid as a number was encountered.
BMI was read from line 2, columns 3 through 8. Again BMI on the input statement expects numeric values and ran into something else, as did Age
And Period, but that was reading at line 3 as were Baseline, After and Difference.
Now for a very important diagnostic. The part that says Rule is to help identify columns the + are values like 5, 15, 25, 35, etc. the 1, 2,3 are columns 10, 20,30.
The line in the log that starts with 3 shows the TEXT of the line. Which shows program code, not values.
So, why are you attempting to read a file containing CODE into a DATA set?????
The multiple lines are because your INFILE statement has no restriction to read on a single line, typically MISSOVER as used in the Proc Import generated code or TRUNCOVER.
NOTE: Invalid data for Subject in line 1 1-4.
NOTE: Invalid data for BMI in line 2 3-8.
NOTE: Invalid data for Age in line 2 10-75.
NOTE: Invalid data for Period in line 3 9-15.
NOTE: Invalid data for Baseline in line 3 24-24.
NOTE: Invalid data for After in line 3 26-28.
NOTE: Invalid data for Difference in line 3 30-32.
RULE: ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0
3 input Subject Gender $ BMI Age Sequence $ Period Treatment $ Baseline After Difference; 89
Because so many of the variables in the resultant Crossover data set are missing code using it will likely not perform very well. Which is not surprising. So read a proper file containing data though it looks like the WORK.IMPORT is what you wanted.
So for the Data Crossover Infile statement read REFFILE, using a file reference, or '/home/u44908311/food_crossover_project/SBP_n13.csv' instead of "/home/u44908311/food_crossover_project/FoodCrossOverExample.sas". ADD delimiter=',' because the file is comma delimited and one of MISSOVER or TRUNCOVER (just in case one of the lines is short)
I see that you did a Proc Print data=crossover; Did you actually look at any of the results? Most of the variables would have been missing, which is what your proc mixed complains about, and the rest should have looked pretty odd for variables with names like Gender Sequence and Treatment.
So, READ the right file, the right way before attempting any analysis.
... View more