BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
najiah
Calcite | Level 5

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.

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

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.

View solution in original post

8 REPLIES 8
UrvishShah
Fluorite | Level 6

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,


data_null__
Jade | Level 19

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.

Jagadishkatam
Amethyst | Level 16

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

Thanks,
Jag
UrvishShah
Fluorite | Level 6

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,


najiah
Calcite | Level 5

sorry, but may I know what do you mean LRECL and how can we fix it?

data_null__
Jade | Level 19

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.

Tom
Super User Tom
Super User

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.

najiah
Calcite | Level 5

Thank you all.

You're guys helps me a lot.

I wish I can give credit to all of youSmiley Happy

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 8 replies
  • 1366 views
  • 6 likes
  • 5 in conversation