Hi,
I tried to conducting EFA using SAS.
However, there is some errors and I'm not really know how to fix it.
Hopefully you guys are able to help me.
I attached the log from the conducted EFA.
Thank you.
You need to add a LRECL option to your INFILE statement. The lines in your file are going to be longer than 256 characters. Since you are reading 184 variables you will need to have at least 367 characters even if every value is only one character long. Also you might add the TRUNCOVER option to prevent it from jumping to a new line if some are shorter than expected.
DATA MASA_GEL;
INFILE 'C:\Users\nadzatul.abdullah\Documents\My SAS Files\9.3\MASA_GEL.dat' DLM = '09'x DSD LRECL=1000 TRUNCOVER;
INPUT Gender Race A B C D E F Q1-Q176;
RUN;
The actual error message about invalid data on line 130 is because of the * that is appearing in column 35. The other errors I cannot see what it is complaining about. Since it looks like most of your data is single digit numbers then perhaps the '*' represents a missing value? If so then you could ignore this message as SAS will assign missing to the variable where the asterisk appeared.
Hi Najiah,
I think there is invalid data for variable Q115 and Q139...They both are numeric variable and might be there is character values assigned to them...Check the values of Q115 and Q139 in your main file...
Thanks,
Your more immediate problem is LRECL.
NOTE: 567 records were read from the infile 'C:\Users\nadzatul.abdullah\Documents\My SAS
Files\9.3\MASA_GEL.dat'.
The minimum record length was 256.
The maximum record length was 256.
One or more lines were truncated.
NOTE: SAS went to a new line when INPUT statement reached past the end of a line.
Also its better to use the missover in the infile statement in case if the data for few of the variables is missing.
Thanks,
Jagadish
Missover option works better only if the last variabl having missing values but by looking at PDV in attached file, i dont think that there is any need to use missover option...You can use the DSD with MISSOVER if your middle variables are having missing values...
Thanks,
sorry, but may I know what do you mean LRECL and how can we fix it?
LRECL stands for logical record length. You can learn all the details in the SAS documentation.
The LRECL infile statement option default value 256 is too small for your input file. You probably don't know what it should be but you can set it arbitrarily large. You might try LRECL=1024.
When the truncation message is gone you should be reading each line properly. Then you can investigate the invalid data problem.
You need to add a LRECL option to your INFILE statement. The lines in your file are going to be longer than 256 characters. Since you are reading 184 variables you will need to have at least 367 characters even if every value is only one character long. Also you might add the TRUNCOVER option to prevent it from jumping to a new line if some are shorter than expected.
DATA MASA_GEL;
INFILE 'C:\Users\nadzatul.abdullah\Documents\My SAS Files\9.3\MASA_GEL.dat' DLM = '09'x DSD LRECL=1000 TRUNCOVER;
INPUT Gender Race A B C D E F Q1-Q176;
RUN;
The actual error message about invalid data on line 130 is because of the * that is appearing in column 35. The other errors I cannot see what it is complaining about. Since it looks like most of your data is single digit numbers then perhaps the '*' represents a missing value? If so then you could ignore this message as SAS will assign missing to the variable where the asterisk appeared.
Thank you all.
You're guys helps me a lot.
I wish I can give credit to all of you
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.