From: LouisBB on
Dear Hari and Myra,

It looks like one needs a licence for "Sas/Access to Pc File Formats" to
import .sav files. I've checked the documentation, but it's not very clear
about this.

LouisBB.

<my_sas_spot(a)yahoo.com> wrote in message
news:1153931853.387028.172560(a)b28g2000cwb.googlegroups.com...
>I just tried importing a *.sav file to SAS created with SPSS v12 for
> Windows using PROC IMPORT and got the same error message:
>
> ERROR: DBMS type SAV not valid for import.
>
> Is there a special license or something else required to do so? It
> would save A LOT of time and effort if I don't have to convert SPSS
> *.sav files to SPSS *.por files.
>
> Thanks.
> Myra
>
> Hari wrote:
>> LouisBB wrote:
>>
>> > Dear HP,
>> >
>> > Try the Import procedure with SAV as DBMS.
>> >
>> > proc import datafile='C:\myDirectory\mySpssFile.sav' out=mySasDataset
>> > dbms=sav replace; run;
>> >
>>
>> Thanks for the note.
>>
>> When I try proc Import, I get the following error message:-
>>
>> 7 proc import datafile="D:\Work\Assorted stuff\My Project\2005\Raw
>> Data\2006
>> 7 ! 07 07\My project\Product\ProductA_only.sav" out=mySasDataset
>> 8 dbms=sav replace;
>> ERROR: DBMS type SAV not valid for import.
>> NOTE: The SAS System stopped processing this step because of errors.
>> NOTE: PROCEDURE IMPORT used (Total process time):
>> real time 0.00 seconds
>> cpu time 0.01 seconds
>>
>> 8 ! run;
>>
>>
>> Please note I do have SAS PC License (though its in warning period
>> right now).
>>
>> Regards,
>> HP
>> India
>>
>> > http://support.sas.com/onlinedoc/913/getDoc/en/proc.hlp/a000308090.htm
>> >
>> > LouisBB.
>> >
>> > "Hari" <excel_hari(a)yahoo.com> wrote in message
>> > news:1153729306.992657.325640(a)i3g2000cwc.googlegroups.com...
>> > > Hi,
>> > >
>> > > I have a huge SPSS file which I need to read in to SAS. I have saved
>> > > the SPSS file as .POR format and subsequently read it in to SAS.
>> > >
>> > > Issue is Iam not able to read in the value labels from SPSS to SAS.
>> > > Whats the best approach for the same. I have more than 1000 variables
>> > > and many such files.
>> > >
>> > > I have tried using the trial version of SPSS 14 and saving it as
>> > > .Sas7bdat and using the option of "Save value labels in to a SAS
>> > > file"
>> > > but this way for many variables the variable labels dont come up.
>> > >
>> > > I thought that probably saving from SPSS as a SAS Transport file
>> > > mightdo the trick and in SAS when I wrote the following syntax to
>> > > read
>> > > in the newly created transport file "Reading Xpt.xpt"
>> > >
>> > > filename xpthand "C:\Documents and Settings\prasadhh\Local
>> > > Settings\Temp\Temp\Reading Xpt";
>> > >
>> > > proc cimport library=work.try infile=xpthand;
>> > > run;
>> > >
>> > > I get the following error
>> > > 5347 proc cimport library=work.try infile=xpthand;
>> > > -------- ------
>> > > 22 202
>> > > WARNING: The Base Product product with which CIMPORT is associated
>> > > will
>> > > expire within 30 days.
>> > > Please contact your SAS installation representative to have
>> > > it
>> > > renewed.
>> > > ERROR 22-322: Expecting a name.
>> > > ERROR 202-322: The option or parameter is not recognized and will be
>> > > ignored.
>> > > 5348 run;
>> > >
>> > >
>> > > What method should I use so that both value labels and variable
>> > > lables
>> > > are being able to read in to SAS.
>> > >
>> > > Please guide me
>> > >
>> > > Regards,
>> > > HP
>> > > India
>> > >
>


From: Hari on

LouisBB wrote:
> Dear Hari and Myra,
>
> It looks like one needs a licence for "Sas/Access to Pc File Formats" to
> import .sav files. I've checked the documentation, but it's not very clear
> about this.
>
> LouisBB.
>

I do have SAS/PC License and presently I downloaded Service Pack 4 and
ran the syntax again and it seems that Proc Export can export SPSS
files but in my case it is giving a new error which is

19 proc import datafile="C:\Documents and Settings\prasadhh\Local
19 ! Settings\Temp\Temp\ProductA_only.sav" out=mySasDataset
20 dbms=sav replace;
Unknown internal variable type
ERROR: Import unsuccessful. See SAS Log for details.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE IMPORT used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds


Im not sure why am getting "Unknown internal variable type" error.

Anybody has any ideas?

regards,
HP
India


> <my_sas_spot(a)yahoo.com> wrote in message
> news:1153931853.387028.172560(a)b28g2000cwb.googlegroups.com...
> >I just tried importing a *.sav file to SAS created with SPSS v12 for
> > Windows using PROC IMPORT and got the same error message:
> >
> > ERROR: DBMS type SAV not valid for import.
> >
> > Is there a special license or something else required to do so? It
> > would save A LOT of time and effort if I don't have to convert SPSS
> > *.sav files to SPSS *.por files.
> >
> > Thanks.
> > Myra
> >
> > Hari wrote:
> >> LouisBB wrote:
> >>
> >> > Dear HP,
> >> >
> >> > Try the Import procedure with SAV as DBMS.
> >> >
> >> > proc import datafile='C:\myDirectory\mySpssFile.sav' out=mySasDataset
> >> > dbms=sav replace; run;
> >> >
> >>
> >> Thanks for the note.
> >>
> >> When I try proc Import, I get the following error message:-
> >>
> >> 7 proc import datafile="D:\Work\Assorted stuff\My Project\2005\Raw
> >> Data\2006
> >> 7 ! 07 07\My project\Product\ProductA_only.sav" out=mySasDataset
> >> 8 dbms=sav replace;
> >> ERROR: DBMS type SAV not valid for import.
> >> NOTE: The SAS System stopped processing this step because of errors.
> >> NOTE: PROCEDURE IMPORT used (Total process time):
> >> real time 0.00 seconds
> >> cpu time 0.01 seconds
> >>
> >> 8 ! run;
> >>
> >>
> >> Please note I do have SAS PC License (though its in warning period
> >> right now).
> >>
> >> Regards,
> >> HP
> >> India
> >>
> >> > http://support.sas.com/onlinedoc/913/getDoc/en/proc.hlp/a000308090.htm
> >> >
> >> > LouisBB.
> >> >
> >> > "Hari" <excel_hari(a)yahoo.com> wrote in message
> >> > news:1153729306.992657.325640(a)i3g2000cwc.googlegroups.com...
> >> > > Hi,
> >> > >
> >> > > I have a huge SPSS file which I need to read in to SAS. I have saved
> >> > > the SPSS file as .POR format and subsequently read it in to SAS.
> >> > >
> >> > > Issue is Iam not able to read in the value labels from SPSS to SAS.
> >> > > Whats the best approach for the same. I have more than 1000 variables
> >> > > and many such files.
> >> > >
> >> > > I have tried using the trial version of SPSS 14 and saving it as
> >> > > .Sas7bdat and using the option of "Save value labels in to a SAS
> >> > > file"
> >> > > but this way for many variables the variable labels dont come up.
> >> > >
> >> > > I thought that probably saving from SPSS as a SAS Transport file
> >> > > mightdo the trick and in SAS when I wrote the following syntax to
> >> > > read
> >> > > in the newly created transport file "Reading Xpt.xpt"
> >> > >
> >> > > filename xpthand "C:\Documents and Settings\prasadhh\Local
> >> > > Settings\Temp\Temp\Reading Xpt";
> >> > >
> >> > > proc cimport library=work.try infile=xpthand;
> >> > > run;
> >> > >
> >> > > I get the following error
> >> > > 5347 proc cimport library=work.try infile=xpthand;
> >> > > -------- ------
> >> > > 22 202
> >> > > WARNING: The Base Product product with which CIMPORT is associated
> >> > > will
> >> > > expire within 30 days.
> >> > > Please contact your SAS installation representative to have
> >> > > it
> >> > > renewed.
> >> > > ERROR 22-322: Expecting a name.
> >> > > ERROR 202-322: The option or parameter is not recognized and will be
> >> > > ignored.
> >> > > 5348 run;
> >> > >
> >> > >
> >> > > What method should I use so that both value labels and variable
> >> > > lables
> >> > > are being able to read in to SAS.
> >> > >
> >> > > Please guide me
> >> > >
> >> > > Regards,
> >> > > HP
> >> > > India
> >> > >
> >

From: b.bradbury on
> I have tried using the trial version of SPSS 14 and saving it as
> .Sas7bdat and using the option of "Save value labels in to a SAS file"
> but this way for many variables the variable labels dont come up.

I haven't used this new feature. Remember however, that SAS handles
value labels quite differently to SPSS. They are stored in a separate
file to the dataset and linked via the format statement. If SPSS is
creating a SAS format file as well as the data file you then need to
tell SAS where to find it. You set this via the fmtsearch option.

The macro below might be useful for this.

%macro fsadd(lib) ;
%* ------------------------------------------------------
Adds a library to the format search list
(Checks to see if library already included first)
EG if formats are in file FORMATS.SC2 in directory
DIRECTORY you would use
libname test 'DIRECTORY'
%fsadd(test.FORMATS)
------------------------------------------------------;
%local liblist i w newlist ;
%let lib=%upcase(&lib);
%let newlist = &lib ;
%let liblist = %sysfunc ( getoption ( fmtsearch ) ) ;
%let i = 1 ;
%let w = %qscan ( %quote(&liblist) , &i ," ()," ) ;
%do %while ( &w ^= ) ;
%if &w ^= WORK and &w ^= LIBRARY and &w ^= &lib %then %do;
%let newlist = &newlist &w ;
%end;
%let i = %eval ( &i +1 ) ;
%let w = %qscan ( %quote(&liblist) , &i ," ()," ) ;
%end ;
options fmtsearch = ( work %unquote(&newlist) library ) ;
%put NOTE: Current format search list is now: %sysfunc ( getoption (
fmtsearch ) ) ;
%mend fsadd ;