BookmarkSubscribeRSS Feed
Nyruz
Calcite | Level 5

I am working on hospital data in SAS file. I want to understand the label of my variable, but they are coded depened on ICD9, ICD10, Canadian Classification of Diagnostic, Therapeutic, and Surgical procedures, and the Canadian Classification of Health Interventions.  Is there any electronic way to de-lable them.

9 REPLIES 9
ballardw
Super User

Labels in SAS terminology are a charatersitic of a variable. For instance a variable named City can have the label set to display "City of Residence" in procedure output. So "de-label" does not make sense in SAS terms or much manipulation at all.

 

I believe that you are discussing the values of your variables and you want to turn something like V9.2 in "Diabetes diagnosis" or similar.

If that is the case then the most likely way would be to assign Formats to the variable(s). SAS Formats are used to store a value like "V9.3" in the data set but to print text, or show in table viewers, as "Diabetes diagnosis".

 

I have not found a universal format for ICD-9 or ICD-10 yet. And many of the results on google point to files that have been moved. Also different organzations have seen fit to store there local versions in slightly different value layouts such as with or without decimals or underscores, upper or lowercase letters. I have no experience with the Canadian versions at all.

 

I would start by asking in your shop if any one has built any formats for these varaible values yet.

Or you can spend some time looking at the google results for SAS Format ICD-10 and/or  SAS Format ICD-9. Note some of the searches will hit both as a big topic was the change from ICD-9 to ICD-10.

 

If you have a document that is well structured it may be possible to turn it into Proc Format code if you can read the code and the desired text into a data set.

Nyruz
Calcite | Level 5
Hello,
Thank you for your answer.  I have 1178 variables, and I need to check them.  you said I can use Proc Format code and SAS Formats to know the value of my variable, but how can I do that?
ballardw
Super User

@Nyruz wrote:
Hello,
Thank you for your answer.  I have 1178 variables, and I need to check them.  you said I can use Proc Format code and SAS Formats to know the value of my variable, but how can I do that?

Here is a brief example of using a custom format to display a different more human legible value from a list of codes.

proc format library=work;
value $dummy
'A' = "Audi"
'B' = "BMW"
'C' = "Chevrolet"
'P' = "Pontiac"
other = "Not in list"
;
run;

data example;
   input firstcar $ secondcar $ thirdcar $;
datalines;
A A .
B C P
D B A
;
run;

proc print data=example noobs;
   format firstcar  secondcar  thirdcar $dummy.;
run;

Proc format creates the custom format that will display the value on the right side of the = sign instead of the code value on the left. The $ in the format name $dummy says this format is to be used with character varaibles, you could have another format dummy for numeric but they correct name must be used whe applying to variables depending on the variable type.

 

 

The special instruction other displays the text "Not in list" for any code that was not explicitly assigned. Without this instruction the actual value of the variable would display.

 

The data step just creates an example data set containg multiple variables that contain code values do display using the format. Note that just like SAS supplied formats that the format ends in a period when used.

 

The proc print shows one way of displaying the values using the format.

 

If your variables that are going to be displayed using the same format are "nice" , such as Var1 to Var100 then a variable list on the format statement makes the code short:

format Var1 - Var100 $dummy. ;

 

The format could be associated with the variables permanently when created and if the format is available they will by default show the formatted values.

LinusH
Tourmaline | Level 20
That's around 1170 too many...
If you transpose your data then using formats might be of help.
You need to be more specific about your data structure in case you need more than a general help.
The value of the variable is in your data. Does that match the global acclaimed ICD codes you can use public available code-name-grouping tables and apply to your data. Either by formats or joins.
Data never sleeps
Nyruz
Calcite | Level 5

What do you mean by public available code-name-grouping tables. I am a new searcher, so I need more explanation, please.

LinusH
Tourmaline | Level 20
ICD is public domain and it shouldn't be to hars finding it on the internet.
But if your organisation works with diagnosis I would be surprised if you don't keep this as reference data internally.
Data never sleeps
Nyruz
Calcite | Level 5

Do you mean by reference data internally in SAS databease. 

LinusH
Tourmaline | Level 20
In any format that SAS can read.
Since it's not that frequently updated you can even copy and paste from a document.
Data never sleeps
Nyruz
Calcite | Level 5

I am trying to do that from the dictionaries that I have, but it will take long time to do that. I want an electronic way for that.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 9 replies
  • 1179 views
  • 0 likes
  • 3 in conversation