f



SAS Formats - converting SAS dataset into SPSS data

Hi group,

I am new to SAS formats and not sure of what SAS formats are.

Is SAS formats analogous to "Variable & Value Labels" of SPSS.

I have a SAS dataset for which I also have SAS formats separately and I want
to convert it into SPSS data but unable to get value labels.

When I try to look at the SAS dataset, I am unable to do it unless I put
formats in the work folder and then try to open the dataset. I used the
following code to get the SPSS data.

Please suggest me a way to get SPSS data from SAS with value labels.

Thanks,
Karan
____________________________________________________________________________
____________________________________________________________________________
____


SAS CODE:

    libname market 'C:\Market1\working';

    LIBNAME one XPORT 'C:\Market1\working\SPSS\SASXPRT1.DAT';

    LIBNAME FORMT XPORT 'C:\Market1\working\SPSS\SASFORMT.DAT';

    PROC FORMAT LIBRARY = market CNTLOUT=market.FORMTS;

    run;

    options VALIDVARNAME=V6;

    PROC COPY IN = market OUT = one ; SELECT test;

    run;

    PROC COPY IN = market OUT=FORMT; SELECT FORMTS;

    run;

SPSS CODE:

    GET SAS DATA='C:\Market1\working\SPSS\SASXPRT1.DAT' DSET(test)

    /FORMATS='C:\Market1\working\SPSS\SASFORMT.DAT' FSET(FORMTS).
0
karan1 (11)
7/19/2005 7:55:19 AM
comp.soft-sys.sas 142828 articles. 3 followers. Post Follow

4 Replies
924 Views

Similar Articles

[PageSpeed] 0

Hi Karan,

SAS formats are more than SPSS value labels. In SPSS, as you may know,
value labels only associate a textual label with a (numerical) value,
that's all. And with (statistical) procedures both the value and its label
may be printed.

SAS formats can be viewed as some kind of transformation of (numerical and
character) values, often intended for representation purposes (like value
labels, but also quite often for conversion purposes. See the SAS docs,
it's too extensive. With SAS PROCs generally only either unformatted values
or formatted values are being displayed.

Briefly, in SAS any numerical or character value, value range, value list
or value range list can be associated with any numerical or character value
or other format specification.

If you have SAS formats as SAS code with PROC FORMAT then you may try to
change it into SPSS value labels using a text editor. I don't know about
the way via converting SAS formats in datasets. I often use DBMS/copy,
which can convert between many database systems, like SAS and SPSS, but I
never attempted any conversion from SAS to SPSS.

Regards - Jim.
--
Y. (Jim) Groeneveld, MSc., Biostatistician, Vitatron b.v., NL
Jim.Groeneveld_AT_Vitatron.com (replace _AT_ by AT sign)
http://www.vitatron.com, http://home.hccnet.nl/jim.groeneveld

My computer always teaches me something new I thought I knew already.

[common disclaimer]

On Tue, 19 Jul 2005 13:25:19 +0530, Karan Bhatia <karan@ABSOLUTDATA.NET>
wrote:

>Hi group,
>
>I am new to SAS formats and not sure of what SAS formats are.
>
>Is SAS formats analogous to "Variable & Value Labels" of SPSS.
>
>I have a SAS dataset for which I also have SAS formats separately and I
want
>to convert it into SPSS data but unable to get value labels.
>
>When I try to look at the SAS dataset, I am unable to do it unless I put
>formats in the work folder and then try to open the dataset. I used the
>following code to get the SPSS data.
>
>Please suggest me a way to get SPSS data from SAS with value labels.
>
>Thanks,
>Karan
>___________________________________________________________________________
_
>___________________________________________________________________________
_
>____
>
>
>SAS CODE:
>
>    libname market 'C:\Market1\working';
>
>    LIBNAME one XPORT 'C:\Market1\working\SPSS\SASXPRT1.DAT';
>
>    LIBNAME FORMT XPORT 'C:\Market1\working\SPSS\SASFORMT.DAT';
>
>    PROC FORMAT LIBRARY = market CNTLOUT=market.FORMTS;
>
>    run;
>
>    options VALIDVARNAME=V6;
>
>    PROC COPY IN = market OUT = one ; SELECT test;
>
>    run;
>
>    PROC COPY IN = market OUT=FORMT; SELECT FORMTS;
>
>    run;
>
>SPSS CODE:
>
>    GET SAS DATA='C:\Market1\working\SPSS\SASXPRT1.DAT' DSET(test)
>
>    /FORMATS='C:\Market1\working\SPSS\SASFORMT.DAT' FSET(FORMTS).
0
jim1stat (510)
7/19/2005 8:59:22 AM
Hi Jim,

Thanks for your prompt reply on SAS-L.

I do not have formats as code, but as "formats.sasb7cat" which appears with
a icon of a folder with a red dot at lower right corner. I feel its similar
to a zip file.

I know how to use formats code to convert it to SPSS value label code using
a text editor, but don't know how to use this.

I am using SAS 8.2 and SPSS 12.

Thanks,
Karan

Karan Bhatia | karan@absolutdata.net;
AbsolutData Technologies Inc. | http://www.absolutdata.net
+91.11.5163.6400 Ext - 338 (Intl Dialing)
+510.903.1026 Ext - 338 (US Dialing)


-----Original Message-----
From: Jim Groeneveld [mailto:jim1stat@YAHOO.CO.UK]
Sent: Tuesday, July 19, 2005 2:29 PM
To: SAS-L@LISTSERV.UGA.EDU; Karan Bhatia
Subject: Re: SAS Formats - converting SAS dataset into SPSS data

Hi Karan,

SAS formats are more than SPSS value labels. In SPSS, as you may know, value
labels only associate a textual label with a (numerical) value, that's all.
And with (statistical) procedures both the value and its label may be
printed.

SAS formats can be viewed as some kind of transformation of (numerical and
character) values, often intended for representation purposes (like value
labels, but also quite often for conversion purposes. See the SAS docs, it's
too extensive. With SAS PROCs generally only either unformatted values or
formatted values are being displayed.

Briefly, in SAS any numerical or character value, value range, value list or
value range list can be associated with any numerical or character value or
other format specification.

If you have SAS formats as SAS code with PROC FORMAT then you may try to
change it into SPSS value labels using a text editor. I don't know about the
way via converting SAS formats in datasets. I often use DBMS/copy, which can
convert between many database systems, like SAS and SPSS, but I never
attempted any conversion from SAS to SPSS.

Regards - Jim.
--
Y. (Jim) Groeneveld, MSc., Biostatistician, Vitatron b.v., NL
Jim.Groeneveld_AT_Vitatron.com (replace _AT_ by AT sign)
http://www.vitatron.com, http://home.hccnet.nl/jim.groeneveld

My computer always teaches me something new I thought I knew already.

[common disclaimer]

On Tue, 19 Jul 2005 13:25:19 +0530, Karan Bhatia <karan@ABSOLUTDATA.NET>
wrote:

>Hi group,
>
>I am new to SAS formats and not sure of what SAS formats are.
>
>Is SAS formats analogous to "Variable & Value Labels" of SPSS.
>
>I have a SAS dataset for which I also have SAS formats separately and I
want
>to convert it into SPSS data but unable to get value labels.
>
>When I try to look at the SAS dataset, I am unable to do it unless I
>put formats in the work folder and then try to open the dataset. I used
>the following code to get the SPSS data.
>
>Please suggest me a way to get SPSS data from SAS with value labels.
>
>Thanks,
>Karan
>_______________________________________________________________________
>____
_
>_______________________________________________________________________
>____
_
>____
>
>
>SAS CODE:
>
>    libname market 'C:\Market1\working';
>
>    LIBNAME one XPORT 'C:\Market1\working\SPSS\SASXPRT1.DAT';
>
>    LIBNAME FORMT XPORT 'C:\Market1\working\SPSS\SASFORMT.DAT';
>
>    PROC FORMAT LIBRARY = market CNTLOUT=market.FORMTS;
>
>    run;
>
>    options VALIDVARNAME=V6;
>
>    PROC COPY IN = market OUT = one ; SELECT test;
>
>    run;
>
>    PROC COPY IN = market OUT=FORMT; SELECT FORMTS;
>
>    run;
>
>SPSS CODE:
>
>    GET SAS DATA='C:\Market1\working\SPSS\SASXPRT1.DAT' DSET(test)
>
>    /FORMATS='C:\Market1\working\SPSS\SASFORMT.DAT' FSET(FORMTS).
0
karan1 (11)
7/19/2005 9:47:42 AM
Hi Karan,

Well, then you have a format catalog, in its specific format, of which you
could make a SAS dataset using the (LIBRARY and) CNTLOUT option of PROC
FORMAT. From the dataset you could try to generate text in the form of SPSS
value labels. Maybe there are, but I don't know of it, other ways SPSS can
handle SAS formats. It's been 9 years since I lastly used SPSS (four win
does).

Regards - Jim.
--
Y. (Jim) Groeneveld, MSc., Biostatistician, Vitatron b.v., NL
Jim.Groeneveld_AT_Vitatron.com (replace _AT_ by AT sign)
http://www.vitatron.com, http://home.hccnet.nl/jim.groeneveld

My computer always teaches me something new I thought I knew already.

[common disclaimer]


On Tue, 19 Jul 2005 15:17:42 +0530, Karan Bhatia <karan@ABSOLUTDATA.NET>
wrote:

>Hi Jim,
>
>Thanks for your prompt reply on SAS-L.
>
>I do not have formats as code, but as "formats.sasb7cat" which appears with
>a icon of a folder with a red dot at lower right corner. I feel its similar
>to a zip file.
>
>I know how to use formats code to convert it to SPSS value label code using
>a text editor, but don't know how to use this.
>
>I am using SAS 8.2 and SPSS 12.
>
>Thanks,
>Karan
>
>Karan Bhatia | karan@absolutdata.net;
>AbsolutData Technologies Inc. | http://www.absolutdata.net
>+91.11.5163.6400 Ext - 338 (Intl Dialing)
>+510.903.1026 Ext - 338 (US Dialing)
>
>
>-----Original Message-----
>From: Jim Groeneveld [mailto:jim1stat@YAHOO.CO.UK]
>Sent: Tuesday, July 19, 2005 2:29 PM
>To: SAS-L@LISTSERV.UGA.EDU; Karan Bhatia
>Subject: Re: SAS Formats - converting SAS dataset into SPSS data
>
>Hi Karan,
>
>SAS formats are more than SPSS value labels. In SPSS, as you may know,
value
>labels only associate a textual label with a (numerical) value, that's all.
>And with (statistical) procedures both the value and its label may be
>printed.
>
>SAS formats can be viewed as some kind of transformation of (numerical and
>character) values, often intended for representation purposes (like value
>labels, but also quite often for conversion purposes. See the SAS docs,
it's
>too extensive. With SAS PROCs generally only either unformatted values or
>formatted values are being displayed.
>
>Briefly, in SAS any numerical or character value, value range, value list
or
>value range list can be associated with any numerical or character value or
>other format specification.
>
>If you have SAS formats as SAS code with PROC FORMAT then you may try to
>change it into SPSS value labels using a text editor. I don't know about
the
>way via converting SAS formats in datasets. I often use DBMS/copy, which
can
>convert between many database systems, like SAS and SPSS, but I never
>attempted any conversion from SAS to SPSS.
>
>Regards - Jim.
>--
>Y. (Jim) Groeneveld, MSc., Biostatistician, Vitatron b.v., NL
>Jim.Groeneveld_AT_Vitatron.com (replace _AT_ by AT sign)
>http://www.vitatron.com, http://home.hccnet.nl/jim.groeneveld
>
>My computer always teaches me something new I thought I knew already.
>
>[common disclaimer]
>
>On Tue, 19 Jul 2005 13:25:19 +0530, Karan Bhatia <karan@ABSOLUTDATA.NET>
>wrote:
>
>>Hi group,
>>
>>I am new to SAS formats and not sure of what SAS formats are.
>>
>>Is SAS formats analogous to "Variable & Value Labels" of SPSS.
>>
>>I have a SAS dataset for which I also have SAS formats separately and I
>want
>>to convert it into SPSS data but unable to get value labels.
>>
>>When I try to look at the SAS dataset, I am unable to do it unless I
>>put formats in the work folder and then try to open the dataset. I used
>>the following code to get the SPSS data.
>>
>>Please suggest me a way to get SPSS data from SAS with value labels.
>>
>>Thanks,
>>Karan
>>_______________________________________________________________________
>>____
>_
>>_______________________________________________________________________
>>____
>_
>>____
>>
>>
>>SAS CODE:
>>
>>    libname market 'C:\Market1\working';
>>
>>    LIBNAME one XPORT 'C:\Market1\working\SPSS\SASXPRT1.DAT';
>>
>>    LIBNAME FORMT XPORT 'C:\Market1\working\SPSS\SASFORMT.DAT';
>>
>>    PROC FORMAT LIBRARY = market CNTLOUT=market.FORMTS;
>>
>>    run;
>>
>>    options VALIDVARNAME=V6;
>>
>>    PROC COPY IN = market OUT = one ; SELECT test;
>>
>>    run;
>>
>>    PROC COPY IN = market OUT=FORMT; SELECT FORMTS;
>>
>>    run;
>>
>>SPSS CODE:
>>
>>    GET SAS DATA='C:\Market1\working\SPSS\SASXPRT1.DAT' DSET(test)
>>
>>    /FORMATS='C:\Market1\working\SPSS\SASFORMT.DAT' FSET(FORMTS).
0
jim1stat (510)
7/19/2005 11:09:11 AM
Karan,

If you are running SAS interactively, you can view the files in the SAS
explorer window if you first execute the statement

Options nofmterr;

This will allow you to open the file for viewing without having the format
catalog.


Daniel J. Nordlund
Research and Data Analysis
Washington State Department of Social and Health Services
Olympia, WA  98504-5204


-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Karan
Bhatia
Sent: Tuesday, July 19, 2005 2:48 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Re: SAS Formats - converting SAS dataset into SPSS data

Hi Jim,

Thanks for your prompt reply on SAS-L.

I do not have formats as code, but as "formats.sasb7cat" which appears with
a icon of a folder with a red dot at lower right corner. I feel its similar
to a zip file.

I know how to use formats code to convert it to SPSS value label code using
a text editor, but don't know how to use this.

I am using SAS 8.2 and SPSS 12.

Thanks,
Karan

Karan Bhatia | karan@absolutdata.net;
AbsolutData Technologies Inc. | http://www.absolutdata.net
+91.11.5163.6400 Ext - 338 (Intl Dialing)
+510.903.1026 Ext - 338 (US Dialing)


-----Original Message-----
From: Jim Groeneveld [mailto:jim1stat@YAHOO.CO.UK]
Sent: Tuesday, July 19, 2005 2:29 PM
To: SAS-L@LISTSERV.UGA.EDU; Karan Bhatia
Subject: Re: SAS Formats - converting SAS dataset into SPSS data

Hi Karan,

SAS formats are more than SPSS value labels. In SPSS, as you may know, value
labels only associate a textual label with a (numerical) value, that's all.
And with (statistical) procedures both the value and its label may be
printed.

SAS formats can be viewed as some kind of transformation of (numerical and
character) values, often intended for representation purposes (like value
labels, but also quite often for conversion purposes. See the SAS docs, it's
too extensive. With SAS PROCs generally only either unformatted values or
formatted values are being displayed.

Briefly, in SAS any numerical or character value, value range, value list or
value range list can be associated with any numerical or character value or
other format specification.

If you have SAS formats as SAS code with PROC FORMAT then you may try to
change it into SPSS value labels using a text editor. I don't know about the
way via converting SAS formats in datasets. I often use DBMS/copy, which can
convert between many database systems, like SAS and SPSS, but I never
attempted any conversion from SAS to SPSS.

Regards - Jim.
--
Y. (Jim) Groeneveld, MSc., Biostatistician, Vitatron b.v., NL
Jim.Groeneveld_AT_Vitatron.com (replace _AT_ by AT sign)
http://www.vitatron.com, http://home.hccnet.nl/jim.groeneveld

My computer always teaches me something new I thought I knew already.

[common disclaimer]

On Tue, 19 Jul 2005 13:25:19 +0530, Karan Bhatia <karan@ABSOLUTDATA.NET>
wrote:

>Hi group,
>
>I am new to SAS formats and not sure of what SAS formats are.
>
>Is SAS formats analogous to "Variable & Value Labels" of SPSS.
>
>I have a SAS dataset for which I also have SAS formats separately and I
want
>to convert it into SPSS data but unable to get value labels.
>
>When I try to look at the SAS dataset, I am unable to do it unless I
>put formats in the work folder and then try to open the dataset. I used
>the following code to get the SPSS data.
>
>Please suggest me a way to get SPSS data from SAS with value labels.
>
>Thanks,
>Karan
>_______________________________________________________________________
>____
_
>_______________________________________________________________________
>____
_
>____
>
>
>SAS CODE:
>
>    libname market 'C:\Market1\working';
>
>    LIBNAME one XPORT 'C:\Market1\working\SPSS\SASXPRT1.DAT';
>
>    LIBNAME FORMT XPORT 'C:\Market1\working\SPSS\SASFORMT.DAT';
>
>    PROC FORMAT LIBRARY = market CNTLOUT=market.FORMTS;
>
>    run;
>
>    options VALIDVARNAME=V6;
>
>    PROC COPY IN = market OUT = one ; SELECT test;
>
>    run;
>
>    PROC COPY IN = market OUT=FORMT; SELECT FORMTS;
>
>    run;
>
>SPSS CODE:
>
>    GET SAS DATA='C:\Market1\working\SPSS\SASXPRT1.DAT' DSET(test)
>
>    /FORMATS='C:\Market1\working\SPSS\SASFORMT.DAT' FSET(FORMTS).
0
NordlDJ (920)
7/19/2005 5:17:33 PM
Reply: