SAS User File for SAFENET1 Data This file contains information and sample SAS programs to create a permanent SAS dataset, for users who want to use SAS in processing the SAFENET1 data provided in this release. There are two ways to create a permanent SAS dataset, using either the SAS transport data file (SAFENET1.SSP) or the ASCII data file (SAFENET1.DAT) supplied in this release. Section A provides a sample SAS program for the first alternative, which is to convert the SAS transport data file to a regular SAS dataset, using the SAS PROCedure: XCOPY. Section B provides a sample SAS program for the second alternative, which is to read data from the ASCII data file, using a SAS DATA step with INFILE, INPUT, and LABEL statements. Section C explains format-related SAS statements that a user may optionally use when working with the SAS dataset. Examples of SAS programs (DATA step or PROC) are provided in all three sections, primarily for the benefit of inexperienced users. Section D contains complete SAS statements that must be used in the programs described in Sections B and C. INCLUDED BELOW ARE NOTES APPLICABLE TO USERS OF SAS VERSION 8. ****************************************************************************** The sample SAS programs provided in Sections A and B show how to create a permanent SAS dataset from the data files provided in this release. A. A Sample SAS Program for Converting the SAS Transport File to a Permanent SAS Dataset The SAS PROCedure XCOPY will read a SAS transport data file and convert the data to regular SAS format, storing the output in a permanent SAS dataset. This permanent SAS dataset can then be used for all future processing and analyses. Below is a sample PC-SAS program that can be used to convert the SAS transport file to a permanent PC SAS dataset (in a Windows environment, with SAS V6.12). LIBNAME PUFLIB 'C:\SN'; FILENAME IN1 'C:\SN\SAFENET1.SSP'; PROC XCOPY IN=IN1 OUT=PUFLIB IMPORT; RUN; If the user wants a list of variables and a few sample records in the permanent SAS dataset, following are the SAS statements to accomplish these. PROC CONTENTS DATA=PUFLIB.SAFENET1; TITLE "List of Variables in Safety Net SAFENET1 SAS Dataset"; RUN; PROC PRINT DATA=PUFLIB.SAFENET1 (OBS=20); TITLE "First 20 Observations in Safety Net SAFENET1 SAS Dataset"; RUN; The LIBNAME statement tells SAS the location (directory name) to store the permanent SAS dataset which is output by PROC XCOPY. The FILENAME statement tells SAS the location (complete directory and file name) of the input SAS transport data file. NOTES: 1) The names used in the LIBNAME and FILENAME statements shown above (i.e., PUFLIB, IN1) are arbitrary; they are only temporary aliases. 2) The directory and file names used in the LIBNAME and FILENAME statements shown above are Windows syntax and may need to be modified for other operating systems such as UNIX, MAC/OS, VMS, or OS/2. 3) SAFENET1 is the internal SAS dataset name (also the PC file name, without the extension) prior to the creation of the SAS transport data file. After running PROC XCOPY, the output SAS dataset assumes the same dataset name (or file name). Hence, in the example above, a file named SAFENET1.SD2 will be created under the C:\SN directory when PROC XCOPY runs successfully. 4) The SAS transport file SAFENET1.SSP was created from a PC-SAS Version 6.12 data file, using PROC COPY. This file has been tested for use with PC-SAS version 6.10 or higher, or with mainframe SAS version 6.08 or higher. This file may work with earlier versions of SAS, although it has not been tested with those versions. Users who are unable to use this SAS Transport file should instead convert the ASCII data file SAFENET1.DAT to a SAS data set as described in Section B. ADDITONAL NOTE TO USERS OF SAS VERSION 8: One of the following procedures should be used to avoid a SAS error when using the downloaded SAS Transport file: 1) Add V8 to LIBNAME statement - e.g., LIBNAME PUFLIB V8 'C:\SN'; OR 2) Output the SAS data set to a different library than the one which contains the downloaded SAS Transport file - e.g., LIBNAME PUFLIB 'C:\SN'; FILENAME IN1 'C:\DOWNLOAD\SAFENET1.SSP'; PROC XCOPY IN=IN1 OUT=PUFLIB IMPORT; RUN; B. A Sample SAS Program for Converting the ASCII Data File to a Permanent SAS Dataset The complete SAS statements (INPUT and LABEL) included in Section D are intended to save time for those users wishing to create a permanent SAS dataset from the SAFENET1.DAT ASCII data file. These statements must be used in combination with other SAS statements to create the appropriate SAS program, as shown below. To use the statements provided in Section D to create a SAS program, you will need an ASCII text editor. If you are using an interactive form of SAS (Windows, UNIX, OS2, etc.), use the editor provided as part of the SAS software. Following is a sample SAS program that will convert the ASCII data file to SAS format. LIBNAME PUFLIB 'C:\SN'; FILENAME IN1 'C:\SN\SAFENET1.DAT'; DATA PUFLIB.SAFENET1; INFILE IN1 LRECL=1242; INPUT .....; * to user: insert the complete INPUT statement that is provided in Section D; LABEL .....; * to user: insert the complete LABEL statement that is provided in Section D; RUN; Here is an explanation of the SAS statements used in the program above. LIBNAME statement: This tells SAS the location (directory name) of the permanent SAS dataset. FILENAME statement: This tells SAS the location of the input ASCII data file. DATA statement: This signifies the beginning of a SAS DATA step and specifies describes the output SAS dataset, referencing the LIBNAME entry (PUFLIB) and assigning an internal SAS dataset name (SAFENET1). In the example, after the successful completion of the DATA step, a PC file named SAFENET1.SD2 would have been created in the C:\SN directory. INFILE statement: This tells SAS the location (directory and file name) of the input ASCII data file. Also provided is the logical record length (1242 bytes), with the default of RECFM=V implied when this parameter is omitted. LRECL and RECFM are optional parameters in the INFILE statement. With regard to these options, please note the following: the ASCII data file SAFENET1.DAT contains a 2-byte carriage return/line feed at the end of each record. When converting to a PC-SAS file, the LRECL option should be used to specify the record length to avoid use of a default record length by PC-SAS. If the RECFM=V option is used, the LRECL option must be specified as the logical record length (e.g., 1242 for SAFENET1.DAT). If RECFM=F is used, then the LRECL value must be specified as the logical record length plus 2 (1244 for SAFENET1.DAT). Note that if the RECFM option is omitted, then the default option of RECFM=V is automatically used, and LRECL should be specified as the logical record (1242 for SAFENET1.DAT). INPUT statement: This specifies the input record layout, giving names and the beginning and ending column positions for data items (which become SAS variables) in the ASCII data file (SAFENET1.DAT). Variable type (numeric or character) is also defined via the INPUT statement. LABEL statement: This associates descriptive names with the SAS variables. RUN statement: This tells SAS to execute all commands up to this point. ADDITONAL NOTE TO USERS OF SAS VERSION 8: One of the following procedures should be used to avoid a SAS error when using the downloaded ASCII data file: 1) Add V8 to LIBNAME statement - e.g., LIBNAME PUFLIB V8 'C:\SN'; OR 2) Output the SAS data set to a different library than the one which contains the downloaded ASCII data file - e.g., LIBNAME PUFLIB 'C:\SN'; FILENAME IN1 'C:\DOWNLOAD\SAFENET1.DAT'; DATA PUFLIB.SAFENET1; INFILE IN1 LRECL=1242; C. Optional Format-related SAS Statements If a user wants to use formats for the SAS variables, a SAS format library must first be created. Below is a SAS program that will accomplish this. LIBNAME PUFLIB 'C:\SN'; PROC FORMAT LIBRARY=PUFLIB; VALUE .....; * to user: insert the complete set of VALUE statements found in Section D; VALUE .....; .......... ; RUN; Below is an example of how to use the SAS formats defined by the PROC FORMAT procedure. LIBNAME PUFLIB 'C:\SN'; OPTIONS FMTSEARCH=(PUFLIB); PROC FREQ DATA=PUFLIB.SAFENET1; TABLES .... / LIST MISSING; FORMAT varnam1 fmtnam1. Varnam2 fmtnam2. .... ; * to user: substitute varnami and fmtnami with actual variable names and format names; * Insert the FORMAT statement provided in Section D, if you are using all the variables; * in the TABLES statement; TITLE "Frequency Distributions ...."; RUN; Here is an explanation of the SAS statements used above. LIBNAME statement: This tells SAS the location (directory name) of the SAS format library. Please note that SAS datasets (file name extension is 'SD2') and format libraries (file name extension is 'SC2') can be stored under the same directory. OPTIONS FMTSEARCH=...: This specifies the SAS format library. PROC FORMAT statement: This identifies the SAS procedure that will make SAS formats according to VALUE statements. Formats will be stored in a file named FORMATS.SC2. Please note that the option 'LIBRARY=...' can be omitted, if the user does not want to create a permanent SAS format library. When simply 'PROC FORMAT;' is used, the formats are defined only for the duration of the batch SAS program or an interactive SAS session. VALUE statement: This gives a) names to formats; and b) descriptive labels for individual values, or range of values. The format names can then be invoked using a FORMAT statement, if desired. PROC FREQ statement: This identifies the SAS procedure that will generate frequency distributions of variables specified in the TABLES statement, formatted if a FORMAT statement is used. The input SAS dataset is specified in the 'DATA=' option. FORMAT statement: This associates existing formats with variables. When using this statement, the formats must have already been created with a PROC FORMAT procedure. RUN statement: This tells SAS to execute all commands up to this point. NOTES: 1) Use of formats is entirely optional, and depends on the type of analyses that you are doing. It is recommended that you create and use them as appropriate. 2) The names used in the LIBNAME and FILENAME statements shown above (i.e., PUFLIB, IN1) are arbitrary; they are only temporary aliases. 3) You only create the permanent SAS data set once. Additional analyses can be run using this permanent dataset. 4) The file and directory specifications in the LIBNAME and FILENAME statements are Windows syntax and may need to be modified for other operating systems such as UNIX, MAC/OS, VMS, or OS/2. D. SAS Statements This section contains SAS INPUT, LABEL, FORMAT and VALUE statements for use in converting the ASCII SAFENET1.DAT file into a SAS data set, and for creating SAS formats. * INPUT STATEMENTS; INFILE IN LRECL=1242; INPUT @1 STATE $4.0 @5 MSA $48.0 @53 COUNTY $48.0 @101 CITY $48.0 @149 RESIDUAL $48.0 @197 OBSTYPE 1.0 @198 METRO 4.0 @202 UNIQFIPS $15.0 @217 STFIPS $2.0 @219 MSAFIPS $4.0 @223 CONTFIPS $4.0 @227 CITYFIPS $5.0 @232 RESFIPS $4.0 @236 STATEID 2.0 @238 MSAID 4.0 @242 COUNTYID 4.0 @246 CITYID 4.0 @250 RESID 4.0 @254 UNINU65 9.4 @263 UNINLINC 9.4 @272 POVTOT 7.4 @279 POV0_17 7.4 @286 POV18_64 7.4 @293 POV65PL 7.4 @300 DIS5_20 7.4 @307 DIS21_64 7.4 @314 DIS65PL 7.4 @321 AIDS 9.4 @330 MCAIDCOV 9.4 @339 MCAIDENR 9.4 @348 MCAIDEXP 9.4 @357 MCAREDSH 9.4 @366 CHCPRES 4.0 @370 UNCPOOL 1.0 @371 PUBLIC 9.4 @380 NONPROF 9.4 @389 INVOWN 9.4 @398 NOTEACH 9.4 @407 LOTEACH 9.4 @416 MODTEACH 9.4 @425 MAJTEACH 9.4 @434 UMMKT 9.4 @443 UMCSI 9.4 @452 UMGINI 9.4 @461 UMHIBURD 9.4 @470 OUTPVST 9.4 @479 CAPGRANT 4.0 @483 HMOCOMP 9.4 @492 HMOPEN 9.4 @501 MCAREMCP 9.4 @510 PEDS 9.4 @519 ADULTPCP 9.4 @528 OBGYN 9.4 @537 MEDSPEC 9.4 @546 SURGSPEC 9.4 @555 INPBEDS 9.4 @564 INPADM 9.4 @573 EDVISITS 9.4 @582 TOTPOP 8.0 @590 SQMILES 11.4 @601 POPDENS 10.4 @611 POP0_17 7.4 @618 POP18_64 7.4 @625 POP65PL 7.4 @632 PCHTOT 8.4 @640 PCH0_17 8.4 @648 PCH18_64 8.4 @656 PCH65PL 8.4 @664 WHITE 9.4 @673 BLACK 9.4 @682 ASIAN 9.4 @691 NATAMER 9.4 @700 HAWPI 9.4 @709 RACEOTH 9.4 @718 MULTRACE 9.4 @727 HISPANIC 9.4 @736 MEXICAN 9.4 @745 PUERTORI 9.4 @754 CUBAN 9.4 @763 OTHHISP 9.4 @772 RDISSBLK 9.4 @781 RDISSHSP 9.4 @790 RDISSNWH 9.4 @799 ECONGINI 6.4 @805 ECONDISS 9.4 @814 FORBORN 9.4 @823 INUSLT10 9.4 @832 NATCITZN 9.4 @841 BRNLATAM 9.4 @850 BRNASIA 9.4 @859 BRNAFRIC 9.4 @868 BRNEUROP 9.4 @877 BRNNOAM 9.4 @886 BRNOCEAN 9.4 @895 NOENGHM 9.4 @904 ENGLTVW 9.4 @913 MEDHHINC 10.4 @923 INCLT15K 7.4 @930 INCGT75K 7.4 @937 PBASSIST 7.4 @944 PBASTAMT 9.4 @953 NOLABFOR 7.4 @960 UNEMP 7.4 @967 ALONETOT 7.4 @974 ALONE65 7.4 @981 SINGPAR 7.4 @988 OWNOCC 7.4 @995 VACRATE 7.4 @1002 HOUS0_10 7.4 @1009 HOUS30 7.4 @1016 HSLESS 7.4 @1023 SOMECOLL 7.4 @1030 CRIME 9.4 @1039 HRT0_17 9.4 @1048 HAD0_17 9.4 @1057 HOE0_17 9.4 @1066 HRT18_39 9.4 @1075 HAD18_39 9.4 @1084 HOE18_39 9.4 @1093 HRT40_64 9.4 @1102 HAD40_64 9.4 @1111 HOE40_64 9.4 @1120 BIRTHS 6.0 @1126 PRENRATE 9.4 @1135 PRENRATM 9.4 @1144 PRENOER 9.4 @1153 LBWRATE 9.4 @1162 LBWRATM 9.4 @1171 LBWOER 9.4 @1180 PRETRATE 9.4 @1189 PRETRATM 9.4 @1198 PRETOER 9.4 @1207 NOUSC 9.4 @1216 UNABLE 9.4 @1225 NOVST1YR 9.4 @1234 NOVST2YR 9.4 ; * FORMAT STATEMENTS; FORMAT STATE $STATE. MSA $MSA. COUNTY $COUNTY. CITY $CITY. RESIDUAL $RESIDUA. OBSTYPE OBSTYPE. METRO METRO. UNIQFIPS $UNIQFIP. STFIPS $STFIPS. MSAFIPS $MSAFIPS. CONTFIPS $CONTFIP. CITYFIPS $CITYFIP. RESFIPS $RESFIPS. STATEID STATEID. MSAID MSAID. COUNTYID COUNTYID. CITYID CITYID. RESID RESID. UNINU65 UNINU65X. UNINLINC UNINLINC. POVTOT POVTOT. POV0_17 POV0_17X. POV18_64 POV1864X. POV65PL POV65PL. DIS5_20 DIS5_20X. DIS21_64 DIS2164X. DIS65PL DIS65PL. AIDS AIDS. MCAIDCOV MCAIDCOV. MCAIDENR MCAIDENR. MCAIDEXP MCAIDEXP. MCAREDSH MCAREDSH. CHCPRES CHCPRES. UNCPOOL UNCPOOL. PUBLIC PUBLIC. NONPROF NONPROF. INVOWN INVOWN. NOTEACH NOTEACH. LOTEACH LOTEACH. MODTEACH MODTEACH. MAJTEACH MAJTEACH. UMMKT UMMKT. UMCSI UMCSI. UMGINI UMGINI. UMHIBURD UMHIBURD. OUTPVST OUTPVST. CAPGRANT CAPGRANT. HMOCOMP HMOCOMP. HMOPEN HMOPEN. MCAREMCP MCAREMCP. PEDS PEDS. ADULTPCP ADULTPCP. OBGYN OBGYN. MEDSPEC MEDSPEC. SURGSPEC SURGSPEC. INPBEDS INPBEDS. INPADM INPADM. EDVISITS EDVISITS. TOTPOP TOTPOP. SQMILES SQMILES. POPDENS POPDENS. POP0_17 POP0_17X. POP18_64 POP1864X. POP65PL POP65PL. PCHTOT PCHTOT. PCH0_17 PCH0_17X. PCH18_64 PCH1864X. PCH65PL PCH65PL. WHITE WHITE. BLACK BLACK. ASIAN ASIAN. NATAMER NATAMER. HAWPI HAWPI. RACEOTH RACEOTH. MULTRACE MULTRACE. HISPANIC HISPANIC. MEXICAN MEXICAN. PUERTORI PUERTORI. CUBAN CUBAN. OTHHISP OTHHISP. RDISSBLK RDISSBLK. RDISSHSP RDISSHSP. RDISSNWH RDISSNWH. ECONGINI ECONGINI. ECONDISS ECONDISS. FORBORN FORBORN. INUSLT10 INUSLT. NATCITZN NATCITZN. BRNLATAM BRNLATAM. BRNASIA BRNASIA. BRNAFRIC BRNAFRIC. BRNEUROP BRNEUROP. BRNNOAM BRNNOAM. BRNOCEAN BRNOCEAN. NOENGHM NOENGHM. ENGLTVW ENGLTVW. MEDHHINC MEDHHINC. INCLT15K INCLT15K. INCGT75K INCGT75K. PBASSIST PBASSIST. PBASTAMT PBASTAMT. NOLABFOR NOLABFOR. UNEMP UNEMP. ALONETOT ALONETOT. ALONE65 ALONE65X. SINGPAR SINGPAR. OWNOCC OWNOCC. VACRATE VACRATE. HOUS0_10 HOUS0X. HOUS30 HOUS30X. HSLESS HSLESS. SOMECOLL SOMECOLL. CRIME CRIME. HRT0_17 HRT0_17X. HAD0_17 HAD0_17X. HOE0_17 HOE0_17X. HRT18_39 HRT1839X. HAD18_39 HAD1839X. HOE18_39 HOE1839X. HRT40_64 HRT4064X. HAD40_64 HAD4064X. HOE40_64 HOE4064X. BIRTHS BIRTHS. PRENRATE PRENRATE. PRENRATM PRENRATM. PRENOER PRENOER. LBWRATE LBWRATE. LBWRATM LBWRATM. LBWOER LBWOER. PRETRATE PRETRATE. PRETRATM PRETRATM. PRETOER PRETOER. NOUSC NOUSC. UNABLE UNABLE. NOVST1YR NOVST1YR. NOVST2YR NOVST2YR. ; * LABEL STATEMENTS; LABEL STATE ='STATE NAME' MSA ='MSA NAME' COUNTY ='COUNTY NAME' CITY ='CITY NAME' RESIDUAL='COUNTY RESIDUAL NAME' OBSTYPE ='TYPE OF OBSERVATION/GEOGRAPHIC UNIT' METRO ='OBSERVATION IS AN MSA' UNIQFIPS='(ST+MSA+COUNTY+CITY+RESIDUL) FIPS ID' STFIPS ='STATE FIPS ID' MSAFIPS ='MSA FIPS ID' CONTFIPS='COUNTY FIPS ID' CITYFIPS='CITY FIPS ID' RESFIPS ='RESIDUAL FIPS ID (=PARENT COUNTY FIPS+X)' STATEID ='UNIQUE STATE ID FOR STATES IN MSA FILE' MSAID ='UNIQUE MSA ID (SEQUENCE NUMBER)' COUNTYID='UNIQUE COUNTY ID (SEQUENCE NUMBER)' CITYID ='UNIQUE CITY ID (SEQUENCE NUMBER)' RESID ='UNIQUE RESIDUAL ID (SEQUENCE NUMBER)' UNINU65 ='% OF POP