Does anyone have any insight into SPSS .por file conversion in EG? I am able to import the file but I only am able to get the values but not the data dictionary which shows what the values are actually relating to. Any suggetions would be of help.
I do not believe that there is an automated way to have SAS convert the SPSS data dictionary into a SAS format library. SAS formats are stored in a separate location. So, for example, if you do this:
[pre]
proc format fmtlib;
value agefmt low-12 = 'preteen'
13-17 = 'teenager'
other='young adult';
run;
proc freq data=sashelp.class;
title 'Using AGEFMT. Format';
tables age;
format age agefmt.;
run;
[/pre]
You will see that, for this run of PROC FREQ, the AGE variable values have been "recoded". But, the format values are not stored with the data. I could make a different format that has different values:
[pre]
proc format fmtlib;
value othrage low-12 = 'can talk to'
13-14 = 'might be able to talk to'
15-16='canNOT talk to'
other='can reason with';
run;
proc freq data=sashelp.class;
title 'Using OTHRAGE. Format';
tables age;
format age othrage.;
run;[/pre]
And then this new PROC FREQ will use the second format for its tables.
Perhaps someone who's used EG and SPSS can help you figure out how to accomplish what you need to do or you could contact Tech Support for further help constructing the formats you need.
cynthia
Output using first format:
[pre]
Using AGEFMT. Format
The FREQ Procedure
Cumulative Cumulative
Age Frequency Percent Frequency Percent
-----------------------------------------------------------------
preteen 7 36.84 7 36.84
teenager 12 63.16 19 100.00
[/pre]
Output using second format:
[pre]
Using OTHRAGE. Format
The FREQ Procedure
Cumulative Cumulative
Age Frequency Percent Frequency Percent
------------------------------------------------------------------------------
can talk to 7 36.84 7 36.84
might be able to talk to 7 36.84 14 73.68
canNOT talk to 5 26.32 19 100.00
[/pre]
I can get all of that to work. Only problem with the import is that I get the data but nothing to reference it with, i.e. say a country has 4 variables, US, GB, Germany, and France. Each one has a value, US - 1, GB - 2, etc... I only am able to import the numbers without knowing what they represent. Make sense?
The value label question seems to be a common question/problem at universities, because many other sites have a link to this University site: http://www.psych.yorku.ca/lab/sas/spss2sas.htm
Here's a quote about what it says regarding SPSS Value Labels & SAS Formats:
Converting SPSS Value Labels into SAS User-Defined Formats
There is no method provided by either SAS or SPSS to convert SPSS Value Labels into SAS Formats. Many difficult issues are involved, but the problems mostly stem from the following basic difference:
SPSS Value Labels are stored along with the data in the SPSS Active File (or, in permanent form, in the SPSS Save File)
SAS labels for individual values are called Formats, and are stored in a Format Library which is a SAS Catalog separate from the SAS data set.
Further in the article on the above site that they have a program for students to use to convert SPSS value labels into SAS formats, but when you click on the link to download the program, you get a "page not found". Since the web site is undated, it's hard to tell what version of SAS and/or SPSS they were talking about.
Charlie,
Your question is also sas basics.
If you have the original spss.sav file then you may try under sas v9.1.3 sp3 or more a
proc import datafile="d:\...\spss.sav" dbms=sav out=sastable; run;
I think, you find in the Sas work directory sastable.sas7bdat
with (often reworked) formatnames inside and a format.sas7bcat.
Be carefull: in case of many conversions the formats are added to the sas7bcat file
so you need to change the format file name to obtain individual table related catalog files.
try to submit this enriched proc import code from EG
Andre
Andre - I'll give that a shot. I appreciate the help!
The 2025 SAS Hackathon Kicks Off on June 11!
Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.