Error processing SSI file
Skip directly to search Skip directly to A to Z list Skip directly to navigation Skip directly to site content Skip directly to page options
CDC Home

Error processing SSI file

Instructions: Step-by-Step Guide to Accessing NHAMCS-ED Public Use Data Files and Programs to Select Injury Records and Calculate Rates

SAS Statements for Identifying Injury Records in NHAMCS-ED

The following SAS statements run in a SAS data step and identify which NHAMCS emergency department records were injuries based on the NCHS Injury Team's definition of injury (See Recommended definition of initial injury visits to emergency departments for use with the NHAMCS-ED data, available on the injury website, for more information.) The injury indicator field is called INJSPB. Records with "INJSPB=1" are injury records. In 2005, the way in which this field was derived changed due to a change in fields on the record. The data prior to 2001 do not include a variable to determine whether the visit was an initial one or not. Definition of an injury record beginning in 2001 includes initial visit status.

SAS Statements for 2005-06

/*CAUSE1 and DIAG1 are variable names used in our SAS input statement.
CAUSE1 is the variable for "Cause of injury #1"
DIAG1 is the variable for "Physician's diagnosis #1"
INITVIS is an imputed variable to indicate initial visit for problem
INITVIS=1 indicates initial visit*/

CAUSEDET=substr(left(CAUSE1),1,3);
DX13=substr(left(DIAG1),1,3);
DX14=substr(left(DIAG1),1,4);
DX15=substr(left(DIAG1),1,5);

/*defining external cause of injury*/

EXTINJ=0;
IF '800'<==CAUSEDET<='869' OR '880'<=CAUSEDET<='929' OR '950'<=CAUSEDET<='999' THEN EXTINJ=1;
IF ('870'<=CAUSEDET<='879') OR ('930'<=CAUSEDET<='949') THEN EXTINJ=2;

/*defining first listed injury diagnosis*/

NEWINJ=0;
IF ('8000'<= DX14<='9092') OR DX14='9094' OR ('9099'<=DX14<='9949') OR ('99550'<=DX15<='99559') OR ('99580'<=DX15<='99585') THEN NEWINJ=1;
IF DX13 < '800' or DX13 >'999' THEN NEWINJ=2;

/*defining injury records */

INJSPB=0;
IF INITVIS =1 AND ((NEWINJ=1 AND (EXTINJ = 1 OR EXTINJ=0)) OR (NEWINJ=2 AND EXTINJ=1))
THEN INJSPB=1;

SAS Statements for 2001-04, 2007

/*CAUSE1 and DIAG1 are variable names used in our SAS input statement.
CAUSE1 is the variable for "Cause of injury #1"
DIAG1 is the variable for "Physician's diagnosis #1"
EPISODE is the variable for "Episode of care"
EPISODE=1 indicates initial visit */

CAUSEDET=substr(left(CAUSE1),1,3);
DX13=substr(left(DIAG1),1,3);
DX14=substr(left(DIAG1),1,4);
DX15=substr(left(DIAG1),1,5);

/*defining external cause of injury*/

EXTINJ=0;
IF '800'<=CAUSEDET<='869' OR '880'<=CAUSEDET<='929' OR '950'<=CAUSEDET<='999' THEN EXTINJ=1;
IF ('870'<=CAUSEDET<='879') OR ('930'<=CAUSEDET<='949') THEN EXTINJ=2;

/*defining first listed injury diagnosis*/

NEWINJ=0;
IF ('8000'<= DX14<='9092') OR DX14='9094' OR ('9099'<=DX14<='9949') OR
('99550'<=DX15<='99559')OR ('99580'<=DX15<='99585') THEN NEWINJ=1;
IF DX13 < '800' or DX13 >'999' THEN NEWINJ=2;

/*defining injury records */

INJSPB=0;
IF EPISODE =1 AND ((NEWINJ=1 AND (EXTINJ = 1 OR EXTINJ=0)) OR (NEWINJ=2 AND EXTINJ=1)) THEN INJSPB=1;

SAS Statements for 1995-2000

/*CAUSE1 and DIAG1 are variable names used in our SAS input statement.
CAUSE1 is the variable for "Cause of injury #1"
DIAG1 is the variable for "Physician's diagnosis #1"
Variable "Episode" not available prior to 2001*/

CAUSEDET=substr(left(CAUSE1),1,3);
DX13=substr(left(DIAG1),1,3);
DX14=substr(left(DIAG1),1,4);
DX15=substr(left(DIAG1),1,5);

/*defining external cause of injury*/

EXTINJ=0;
IF '800'<=CAUSEDET<='869' OR '880'<=CAUSEDET<='929' OR '950'<=CAUSEDET<='999' THEN EXTINJ=1;
IF ('870'<=CAUSEDET<='879') OR ('930'<=CAUSEDET<='949') THEN EXTINJ=2;

/*defining first listed injury diagnosis*/

NEWINJ=0;
IF ('8000'<= DX14<='9092') OR DX14='9094' OR ('9099'<=DX14<='9949') OR DX14='9955'
OR ('99580'<=DX15<='99585') THEN NEWINJ=1;
IF DX13 < '800' or DX13 >'999' THEN NEWINJ=2;

/*defining injury records */

NJSPB=0;
IF ((NEWINJ=1 AND (EXTINJ = 1 OR EXTINJ=0)) OR (NEWINJ=2 AND EXTINJ=1)) THEN INJSPB=1;

 
Error processing SSI file
Error processing SSI file
Error processing SSI file
Error processing SSI file
Error processing SSI file
  • Page last reviewed: November 6, 2015
  • Page last updated: June 9, 2010
Error processing SSI file
USA.gov: The U.S. Government's Official Web PortalDepartment of Health and Human Services
Centers for Disease Control and Prevention   1600 Clifton Rd. Atlanta, GA 30329-4027, USA
800-CDC-INFO (800-232-4636) TTY: (888) 232-6348 - Contact CDC-INFO