Date: Mon, 2 Jun 1997 16:13:00 PDT
Reply-To: mullinb{DHWTOWERS/TOWERS2/mullinb}@DHW.STATE.ID.US
Sender: "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From: "Brian O. Mullin"
<mullinb{DHWTOWERS/TOWERS2/mullinb}@DHW.STATE.ID.US>
Subject: Re: SAS formats and PC SUDAAN
on Mon, 2 Jun 1997 10:15:00 EST "Alderton, David"
<dla5@CIDHIV1.EM.CDC.GOV> writes
>
>I'm looking for some help to output and save SAS formats for use with PC
>SUDAAN (version 7.10). The SUDAAN manual says you can use saved SAS
formats
>with the PC version of SUDAAN but it gives no examples. Has someone done
>this who would be willing to provide a couple of examples of (a) saving a
>SAS format for use with SUDAAN and (b) using a SAS format from within
>SUDAAN.
>
>Thanks, David.
>David L. Alderton, Ph.D.
>Centers for Disease Control and Prevention
>HIV/AIDS Surveillance Branch
>Atlanta, GA -- DLA5@CDC.gov
David,
SUDAAN only reads SAS 6.04 datasets. It will not read SAS format catalogs.
Therefore, the cntlout option of proc format must be used to generate a SAS
data set containing the format information. The data set must be version
6.04 (notice the 604 engine specified on the libname statement). The
formats can be specified in the SUDAAN program or in a SAS data step. Be
careful when using formats; they cannot be used to collapse groups i.e.
value ages
1-10 = 1
11-20 =2;
will explode in SUDAAN. SAS and SUDAAN example progams follow.
Brian
libname sas604 v604 'c:\data\temp';
proc format cntlout = sas604.level;
value sexfmt
1='Female'
2='Male';
run;
data sas604.fmt (label='variables formatted in datastep');
input sex;
format sex sexfmt. ;
cards;
1
2
2
2
1
1
2
;
run;
data sas604.notfmt (label='variables not formatted in data step');
input sex;
cards;
1
2
2
2
1
1
2
;
run;
/* SUDAAN program */
/* variables are formatted by format statement in SUDAAN program */
proc crosstab data = "c:\\data\\temp\\notfmt" filetype=sas design=srs;
tables sex ;
subgroup sex ;
levels 2 ;
/* Statement to format sex */
format sex sex. ;
/* variables are formatted in sas datastep */
proc crosstab data = "c:\\data\\temp\\fmt" filetype=sas design=srs;
tables sex ;
subgroup sex ;
levels 2 ;
-----
Brian O. Mullin
Idaho Division of Health,
Center for Vital Statistics and Health Policy
mullinb{dhwtowers/towers2/mullinb}@dhw.state.id.us