BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
no_hassles
Calcite | Level 5

Hello everyone,

 

I am looking to read ICD10 diagnosis codes into one variable and the code description in another variable.

 

What is the input statement switch that will allow me to do this?

 

Example: Newborn only diagnosis codes and descriptions:

 

 

DATA sparcs.input_newborn_icd10_2017;

INPUT DX $ ;

DATALINES;

A33 Tetanus neonatorum

E8411 Meconium ileus in cystic fibrosis

H04531 Neonatal obstruction of right nasolacrimal duct

H04532 Neonatal obstruction of left nasolacrimal duct

H04533 Neonatal obstruction of bilateral nasolacrimal duct

H04539 Neonatal obstruction of unspecified nasolacrimal duct

N470 Adherent prepuce, newborn

Z00110 Health examination for newborn under 8 days old

Z00111 Health examination for newborn 8 to 28 days old

Z3800 Single liveborn infant, delivered vaginally

Z3801 Single liveborn infant, delivered by cesarean

Z381 Single liveborn infant, born outside hospital

Z382 Single liveborn infant, unspecified as to place of birth

Z3830 Twin liveborn infant, delivered vaginally

Z3831 Twin liveborn infant, delivered by cesarean

Z384 Twin liveborn infant, born outside hospital

Z385 Twin liveborn infant, unspecified as to place of birth

Z3861 Triplet liveborn infant, delivered vaginally

Z3862 Triplet liveborn infant, delivered by cesarean

Z3863 Quadruplet liveborn infant, delivered vaginally

Z3864 Quadruplet liveborn infant, delivered by cesarean

Z3865 Quintuplet liveborn infant, delivered vaginally

Z3866 Quintuplet liveborn infant, delivered by cesarean

Z3868 Other multiple liveborn infant, delivered vaginally

Z3869 Other multiple liveborn infant, delivered by cesarean

Z387 Other multiple liveborn infant, born outside hospital

Z388 Other multiple liveborn infant, unsp as to place of birth

;

RUN;

 

This code reads in the ICD10 DX code and stops at the first blank character. Great.

 

How do I read the rest of the data as one character variable, such as NBdescription?

 

I will use this technique multiple times for the numerous code/description pairs I will come across.

 

Thanks in advance.

 

Stephen Dybas

1 ACCEPTED SOLUTION

Accepted Solutions
Astounding
PROC Star

Here's something you could try:

 

data want;

length nbDescription $ 200;

input dx $ nbDescription $ &;

datalines;

....

;

 

 

View solution in original post

4 REPLIES 4
Kurt_Bremser
Super User

Use a sufficiently long informat to force formatted input, and the truncover option:

data test;
infile cards truncover;
input DX $100.;
cards;
A33 Tetanus neonatorum
E8411 Meconium ileus in cystic fibrosis
H04531 Neonatal obstruction of right nasolacrimal duct
H04532 Neonatal obstruction of left nasolacrimal duct
H04533 Neonatal obstruction of bilateral nasolacrimal duct
H04539 Neonatal obstruction of unspecified nasolacrimal duct
N470 Adherent prepuce, newborn
Z00110 Health examination for newborn under 8 days old
Z00111 Health examination for newborn 8 to 28 days old
Z3800 Single liveborn infant, delivered vaginally
Z3801 Single liveborn infant, delivered by cesarean
Z381 Single liveborn infant, born outside hospital
Z382 Single liveborn infant, unspecified as to place of birth
Z3830 Twin liveborn infant, delivered vaginally
Z3831 Twin liveborn infant, delivered by cesarean
Z384 Twin liveborn infant, born outside hospital
Z385 Twin liveborn infant, unspecified as to place of birth
Z3861 Triplet liveborn infant, delivered vaginally
Z3862 Triplet liveborn infant, delivered by cesarean
Z3863 Quadruplet liveborn infant, delivered vaginally
Z3864 Quadruplet liveborn infant, delivered by cesarean
Z3865 Quintuplet liveborn infant, delivered vaginally
Z3866 Quintuplet liveborn infant, delivered by cesarean
Z3868 Other multiple liveborn infant, delivered vaginally
Z3869 Other multiple liveborn infant, delivered by cesarean
Z387 Other multiple liveborn infant, born outside hospital
Z388 Other multiple liveborn infant, unsp as to place of birth
;
run;
Astounding
PROC Star

Here's something you could try:

 

data want;

length nbDescription $ 200;

input dx $ nbDescription $ &;

datalines;

....

;

 

 

no_hassles
Calcite | Level 5
Thanks. That's what the switch I was looking for.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 6127 views
  • 0 likes
  • 3 in conversation