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.
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 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.
What do you mean by public available code-name-grouping tables. I am a new searcher, so I need more explanation, please.
Do you mean by reference data internally in SAS databease.
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.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.