Facing a problem after uploading data from SPSS

Accepted Solution Solved
Reply
Contributor
Posts: 57
Accepted Solution

Facing a problem after uploading data from SPSS

After importing a dataset from SPSS, i open the dataset in SAS successfully only for the first time, then when I close the program and re-open the sas dataset I receive the following error:

ERROR: Format AGGRESS not found or couldn't be loaded for variable Aggressor10.

ERROR: Format TOTALAG not found or couldn't be loaded for variable totalaggressor.

any suggestions how to solve this? I have tried importing once again but i receive the same error.

the above 2 variables are coming from an spss dataset, they are numeric but are coded. i also changed the variable into string however the error I receive is the same

many thanks for this

Neo


Accepted Solutions
Solution
‎09-18-2013 06:19 PM
Super User
Super User
Posts: 7,050

Re: Facing a problem after uploading data from SPSS

Use option nofmterr if you do not care about formats (in SPSS terminology, value labels).

If you do then you need to make sure SAS can find the formats before you access the data set.

If you imported the data from SPSS using PROC IMPORT then you can use the FMTLIB option to tell IMPORT where the store the formats that it generates from the value labels.   SAS/ACCESS(R) 9.3 Interface to PC Files: Reference

Once you re-start SAS you need to tell it to look in the same place to find the formats by using the FMTSEARCH option to point to where you saved the formats.

View solution in original post


All Replies
Super User
Posts: 11,343

Re: Facing a problem after uploading data from SPSS

Two options IIRC. If the data was exported from SPSS there could be file with the name of the dataset and a .sas extenstion that contains the code for formats which should run first before importing the data. This behavior could be dependant on the versions of SPSS and SAS.

The error message is because your default installation of SAS probably set the the option FMTERR which says to treat missing formats as an error. Run

options NOFMTERR;

before importing the data. Or go through the menu Tools>Options>System>Environment Control>Error Handling and set FMTERR to 0.

This will remove the error message and allow the data set to be read and such.

Solution
‎09-18-2013 06:19 PM
Super User
Super User
Posts: 7,050

Re: Facing a problem after uploading data from SPSS

Use option nofmterr if you do not care about formats (in SPSS terminology, value labels).

If you do then you need to make sure SAS can find the formats before you access the data set.

If you imported the data from SPSS using PROC IMPORT then you can use the FMTLIB option to tell IMPORT where the store the formats that it generates from the value labels.   SAS/ACCESS(R) 9.3 Interface to PC Files: Reference

Once you re-start SAS you need to tell it to look in the same place to find the formats by using the FMTSEARCH option to point to where you saved the formats.

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 334 views
  • 3 likes
  • 3 in conversation