I am trying to rerun an old glm model (MANOVA) with code that works in SAS 9.4 but is not working in SAS Studio. Again, this exact code works in older versions of SAS but not this one. I think it may be the data I am inputting that is not getting read correctly, but I don't know what the problem is. Any help is much appreciated! I've attached the original text file with codes as well as screenshots of the output and error messages. Thanks so much!
Eric
ericgriffin742@gmail.com
Add this statement in the data step that reads the data:
infile cards dlm='09'x dsd truncover;
as you have tabs as delimiters.
Hi everyone,
I am trying to rerun an old glm model (MANOVA) with code that works in SAS 9.4 but is not working in SAS Studio. Again, this exact code works in older versions of SAS but not this one. I think it may be the data I am inputting that is not getting read correctly, but I don't know what the problem is. Any help is much appreciated! I've attached the original text file with codes as well as screenshots of the output and error messages. Thanks so much!
Eric
ericgriffin742@gmail.com
I'm not sure whether this page is relevant to my question, but could the problem be that my data are separated by spaces rather than tabs?
https://communities.sas.com/t5/SAS-Programming/Tab-delimiter-error-with-Datalines/td-p/302748
-Eric ric
The first step in your program is reading the data into a dataset.
Get that working first. Then you can work on the actual GLM code.
The problem might be that some editor you used as inserted tabs into your file. (40 years ago editors used to replace spaces with tabs to help save bytes in the documents. A single tab character could replace 2 to 8 space characters.) In SAS Display Manager it would happily replace the tabs with spaces before sending the code to run. But in SAS/Studio it does not provide this service for you and actual tab characters in program files end up being part of the source that SAS reads.
Try telling SAS to expand the tabs in your data lines.
data want;
infile datalines expandtabs;
input ...
datalines;
....
;;;;
Or perhaps just save the lines of data to a separate file and have the data step read from that.
data want;
infile 'myfile.txt' expandtabs ;
input .... ;
run;
Great, this was really helpful. The model is working now!
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.